Fix clippy lints
This commit is contained in:
parent
ce2c795bda
commit
8c74464b0d
2 changed files with 15 additions and 21 deletions
|
|
@ -424,22 +424,19 @@ mod grid {
|
||||||
};
|
};
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
Event::Touch(touch_event) => match touch_event {
|
Event::Touch(touch::Event::FingerMoved { .. }) => {
|
||||||
touch::Event::FingerMoved { .. } => {
|
let message = {
|
||||||
let message = {
|
*interaction = if is_populated {
|
||||||
*interaction = if is_populated {
|
Interaction::Erasing
|
||||||
Interaction::Erasing
|
} else {
|
||||||
} else {
|
Interaction::Drawing
|
||||||
Interaction::Drawing
|
|
||||||
};
|
|
||||||
|
|
||||||
populate.or(unpopulate)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
(event::Status::Captured, message)
|
populate.or(unpopulate)
|
||||||
}
|
};
|
||||||
_ => (event::Status::Ignored, None),
|
|
||||||
},
|
(event::Status::Captured, message)
|
||||||
|
}
|
||||||
Event::Mouse(mouse_event) => match mouse_event {
|
Event::Mouse(mouse_event) => match mouse_event {
|
||||||
mouse::Event::ButtonPressed(button) => {
|
mouse::Event::ButtonPressed(button) => {
|
||||||
let message = match button {
|
let message = match button {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ impl Application for Multitouch {
|
||||||
fn update(&mut self, message: Message) -> Command<Message> {
|
fn update(&mut self, message: Message) -> Command<Message> {
|
||||||
match message {
|
match message {
|
||||||
Message::FingerPressed { id, position } => {
|
Message::FingerPressed { id, position } => {
|
||||||
self.state.fingers.insert(id, position.clone());
|
self.state.fingers.insert(id, position);
|
||||||
self.state.cache.clear();
|
self.state.cache.clear();
|
||||||
}
|
}
|
||||||
Message::FingerLifted { id } => {
|
Message::FingerLifted { id } => {
|
||||||
|
|
@ -94,7 +94,7 @@ impl Application for Multitouch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> canvas::Program<Message> for State {
|
impl canvas::Program<Message> for State {
|
||||||
type State = ();
|
type State = ();
|
||||||
|
|
||||||
fn update(
|
fn update(
|
||||||
|
|
@ -134,11 +134,8 @@ impl<'a> canvas::Program<Message> for State {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect tuples of (id, point);
|
// Collect tuples of (id, point);
|
||||||
let mut zones: Vec<(u64, Point)> = self
|
let mut zones: Vec<(u64, Point)> =
|
||||||
.fingers
|
self.fingers.iter().map(|(id, pt)| (id.0, *pt)).collect();
|
||||||
.iter()
|
|
||||||
.map(|(id, pt)| (id.0, pt.clone()))
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
// Sort by ID
|
// Sort by ID
|
||||||
zones.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap());
|
zones.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue