Skip to content

Commit a22f954

Browse files
committed
apply rustfmt
1 parent 4e130ca commit a22f954

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

cosmic-settings/src/pages/display/arrangement.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const SCALE_THRESHOLD: f32 = 0.05;
2828
const CENTER_THRESHOLD: f32 = 50.0;
2929
pub(super) const EDGE_TOLERANCE: f32 = 1.0;
3030

31-
3231
#[derive(Debug, Clone)]
3332
pub struct Camera2D {
3433
pub position: Point,
@@ -192,10 +191,7 @@ impl ArrangementState {
192191
list.outputs
193192
.get(disp.output_key)
194193
.map(|output| {
195-
let randr_pos = Point::new(
196-
output.position.0 as f32,
197-
output.position.1 as f32,
198-
);
194+
let randr_pos = Point::new(output.position.0 as f32, output.position.1 as f32);
199195
randr_pos != disp.position
200196
})
201197
.unwrap_or(false)
@@ -287,7 +283,8 @@ impl ArrangementState {
287283

288284
fn would_overlap_any(&self, dragged_key: OutputKey, position: Point, size: Size) -> bool {
289285
self.displays.borrow().iter().any(|other| {
290-
other.output_key != dragged_key && Self::rectangles_overlap(position, size, other.bounds())
286+
other.output_key != dragged_key
287+
&& Self::rectangles_overlap(position, size, other.bounds())
291288
})
292289
}
293290

@@ -747,10 +744,7 @@ impl<'a, Message: Clone> Program<Message, Theme, Renderer> for ArrangementCanvas
747744
let displays = state.displays.borrow();
748745
if let Some(display) = displays.iter().find(|d| d.output_key == output_key)
749746
{
750-
let new_pos = (
751-
display.position.x as i32,
752-
display.position.y as i32,
753-
);
747+
let new_pos = (display.position.x as i32, display.position.y as i32);
754748

755749
let old_pos = self
756750
.list

cosmic-settings/src/pages/display/mod.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -928,11 +928,12 @@ impl Page {
928928
return false;
929929
};
930930

931-
let (moving_width, moving_height) = if moving_output.transform.is_none_or(Self::is_landscape) {
932-
(mode.size.0, mode.size.1)
933-
} else {
934-
(mode.size.1, mode.size.0)
935-
};
931+
let (moving_width, moving_height) =
932+
if moving_output.transform.is_none_or(Self::is_landscape) {
933+
(mode.size.0, mode.size.1)
934+
} else {
935+
(mode.size.1, mode.size.0)
936+
};
936937

937938
let moving_width = (moving_width as f64 / moving_output.scale) as u32;
938939
let moving_height = (moving_height as f64 / moving_output.scale) as u32;
@@ -950,11 +951,12 @@ impl Page {
950951
continue;
951952
};
952953

953-
let (other_width, other_height) = if other_output.transform.is_none_or(Self::is_landscape) {
954-
(other_mode.size.0, other_mode.size.1)
955-
} else {
956-
(other_mode.size.1, other_mode.size.0)
957-
};
954+
let (other_width, other_height) =
955+
if other_output.transform.is_none_or(Self::is_landscape) {
956+
(other_mode.size.0, other_mode.size.1)
957+
} else {
958+
(other_mode.size.1, other_mode.size.0)
959+
};
958960

959961
let other_width = (other_width as f64 / other_output.scale) as u32;
960962
let other_height = (other_height as f64 / other_output.scale) as u32;

0 commit comments

Comments
 (0)