Skip to content

Commit

Permalink
removed unused tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
Redhawk18 committed Aug 13, 2023
1 parent f41e064 commit 33bad9a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/selection_list/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct Example {

#[derive(Debug, Clone)]
enum Message {
LanguageSelected((usize, String)),
LanguageSelected(usize, String),
AddAtSelection,
ManualSelection,
}
Expand All @@ -45,7 +45,7 @@ impl Sandbox for Example {

fn update(&mut self, message: Message) {
match message {
Message::LanguageSelected((index, language)) => {
Message::LanguageSelected(index, language) => {
self.selected_language = language;
self.selected_index = index;
self.manual_select = None;
Expand Down
4 changes: 2 additions & 2 deletions src/native/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ where
#[must_use]
pub fn selection_list_with<'a, T, Message, Renderer>(
options: impl Into<Cow<'a, [T]>>,
on_selected: impl Fn((usize, T)) -> Message + 'static,
on_selected: impl Fn(usize, T) -> Message + 'static,
text_size: f32,
padding: f32,
style: <Renderer::Theme as crate::style::selection_list::StyleSheet>::Style,
Expand Down Expand Up @@ -338,7 +338,7 @@ where
#[must_use]
pub fn selection_list<'a, T, Message, Renderer>(
options: impl Into<Cow<'a, [T]>>,
on_selected: impl Fn((usize, T)) -> Message + 'static,
on_selected: impl Fn(usize, T) -> Message + 'static,
) -> crate::SelectionList<'a, T, Message, Renderer>
where
Message: 'a + Clone,
Expand Down
4 changes: 2 additions & 2 deletions src/native/selection_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ where
/// to set those.
pub fn new(
options: impl Into<Cow<'a, [T]>>,
on_selected: impl Fn((usize, T)) -> Message + 'static,
on_selected: impl Fn(usize, T) -> Message + 'static,
) -> Self {
let options = options.into();
let container = Container::new(Scrollable::new(List {
Expand Down Expand Up @@ -97,7 +97,7 @@ where
/// selected, the `style`, `text_size`, `padding` and `font`.
pub fn new_with(
options: impl Into<Cow<'a, [T]>>,
on_selected: impl Fn((usize, T)) -> Message + 'static,
on_selected: impl Fn(usize, T) -> Message + 'static,
text_size: f32,
padding: f32,
style: <Renderer::Theme as StyleSheet>::Style,
Expand Down
4 changes: 2 additions & 2 deletions src/native/selection_list/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ where
/// Style for Font colors and Box hover colors.
pub style: <Renderer::Theme as StyleSheet>::Style,
/// Function Pointer On Select to call on Mouse button press.
pub on_selected: Box<dyn Fn((usize, T)) -> Message>,
pub on_selected: Box<dyn Fn(usize, T) -> Message>,
/// The padding Width
pub padding: f32,
/// The Text Size
Expand Down Expand Up @@ -164,7 +164,7 @@ where
.last_selected_index
.map_or(event::Status::Ignored, |last| {
if let Some(option) = self.options.get(last.0) {
shell.publish((self.on_selected)((last.0, option.clone())));
shell.publish((self.on_selected)(last.0, option.clone()));
event::Status::Captured
} else {
event::Status::Ignored
Expand Down

0 comments on commit 33bad9a

Please sign in to comment.