Skip to content

Commit 0646677

Browse files
0HyperCubeKeavon
authored andcommitted
Fix clippy lints and update packages (#568)
1 parent ef67351 commit 0646677

File tree

9 files changed

+270
-270
lines changed

9 files changed

+270
-270
lines changed

Cargo.lock

Lines changed: 56 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editor/src/document/properties_panel_message_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub struct PropertiesPanelMessageHandler {
9191

9292
impl PropertiesPanelMessageHandler {
9393
fn matches_selected(&self, path: &[LayerId]) -> bool {
94-
let last_active_path = self.active_path.as_ref().map(|v| v.last().copied()).flatten();
94+
let last_active_path = self.active_path.as_ref().and_then(|v| v.last().copied());
9595
let last_modified = path.last().copied();
9696
matches!((last_active_path, last_modified), (Some(active_last), Some(modified_last)) if active_last == modified_last)
9797
}

editor/src/layout/widgets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'a> Iterator for WidgetIter<'a> {
6666
type Item = &'a WidgetHolder;
6767

6868
fn next(&mut self) -> Option<Self::Item> {
69-
if let Some(item) = self.current_slice.map(|slice| slice.first()).flatten() {
69+
if let Some(item) = self.current_slice.and_then(|slice| slice.first()) {
7070
self.current_slice = Some(&self.current_slice.unwrap()[1..]);
7171
return Some(item);
7272
}
@@ -97,7 +97,7 @@ impl<'a> Iterator for WidgetIterMut<'a> {
9797
type Item = &'a mut WidgetHolder;
9898

9999
fn next(&mut self) -> Option<Self::Item> {
100-
if let Some((first, rest)) = self.current_slice.take().map(|slice| slice.split_first_mut()).flatten() {
100+
if let Some((first, rest)) = self.current_slice.take().and_then(|slice| slice.split_first_mut()) {
101101
self.current_slice = Some(rest);
102102
return Some(first);
103103
};

editor/src/viewport_tools/tools/gradient_tool.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl Fsm for GradientToolFsmState {
288288
let dragging_start = data
289289
.selected_gradient
290290
.as_ref()
291-
.map_or(None, |selected| if selected.path == path { Some(selected.dragging_start) } else { None });
291+
.and_then(|selected| if selected.path == path { Some(selected.dragging_start) } else { None });
292292
data.gradient_overlays.push(GradientOverlay::new(gradient, dragging_start, path, layer, document, responses))
293293
}
294294
}
@@ -308,7 +308,7 @@ impl Fsm for GradientToolFsmState {
308308
start_snap(&mut data.snap_handler, document, document.graphene_document.layer(&overlay.path).unwrap(), &overlay.path);
309309
data.selected_gradient = Some(SelectedGradient {
310310
path: overlay.path.clone(),
311-
transform: overlay.transform.clone(),
311+
transform: overlay.transform,
312312
gradient: overlay.gradient.clone(),
313313
dragging_start: true,
314314
})
@@ -318,7 +318,7 @@ impl Fsm for GradientToolFsmState {
318318
start_snap(&mut data.snap_handler, document, document.graphene_document.layer(&overlay.path).unwrap(), &overlay.path);
319319
data.selected_gradient = Some(SelectedGradient {
320320
path: overlay.path.clone(),
321-
transform: overlay.transform.clone(),
321+
transform: overlay.transform,
322322
gradient: overlay.gradient.clone(),
323323
dragging_start: false,
324324
})

editor/src/viewport_tools/vector_editor/vector_anchor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl VectorAnchor {
5050

5151
// TODO Cleanup the internals of this function
5252
/// Move the selected points by the provided delta
53-
pub fn move_selected_points(&mut self, translation: DVec2, relative: bool, path_elements: &mut Vec<kurbo::PathEl>, transform: &DAffine2) {
53+
pub fn move_selected_points(&mut self, translation: DVec2, relative: bool, path_elements: &mut [kurbo::PathEl], transform: &DAffine2) {
5454
let place_mirrored_handle = |center: kurbo::Point, original: kurbo::Point, target: kurbo::Point, selected: bool, mirror_angle: bool, mirror_distance: bool| -> kurbo::Point {
5555
if !selected || !mirror_angle {
5656
return original;

0 commit comments

Comments
 (0)