Skip to content

Commit 52280e9

Browse files
julianbrahaDrakulix
authored andcommitted
Remove unnecessary casting
1 parent 48ae9a2 commit 52280e9

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/backend/winit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ impl WinitState {
112112
.get::<RefCell<OutputConfig>>()
113113
.unwrap()
114114
.borrow_mut();
115-
if dbg!(config.mode.0) != dbg!((size.w as i32, size.h as i32)) {
115+
if dbg!(config.mode.0) != dbg!((size.w, size.h)) {
116116
if !test_only {
117-
config.mode = ((size.w as i32, size.h as i32), None);
117+
config.mode = ((size.w, size.h), None);
118118
}
119119
Err(anyhow::anyhow!("Cannot set window size"))
120120
} else {
@@ -143,7 +143,7 @@ pub fn init_backend(
143143
model: name.clone(),
144144
};
145145
let mode = Mode {
146-
size: (size.w as i32, size.h as i32).into(),
146+
size: (size.w, size.h).into(),
147147
refresh: 60_000,
148148
};
149149
let output = Output::new(name, props);
@@ -157,7 +157,7 @@ pub fn init_backend(
157157
);
158158
output.user_data().insert_if_missing(|| {
159159
RefCell::new(OutputConfig {
160-
mode: ((size.w as i32, size.h as i32), None),
160+
mode: ((size.w, size.h), None),
161161
transform: Transform::Flipped180.into(),
162162
..Default::default()
163163
})

src/input/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ impl State {
18811881
let res = shell.move_current_window(
18821882
seat,
18831883
&current_output,
1884-
(&current_output, Some(workspace as usize)),
1884+
(&current_output, Some(workspace)),
18851885
matches!(x, Action::MoveToLastWorkspace),
18861886
None,
18871887
&mut self.common.workspace_state.update(),
@@ -1904,7 +1904,7 @@ impl State {
19041904
shell.move_current_window(
19051905
seat,
19061906
&current_output,
1907-
(&current_output, Some(workspace as usize)),
1907+
(&current_output, Some(workspace)),
19081908
matches!(x, Action::MoveToNextWorkspace),
19091909
direction,
19101910
&mut self.common.workspace_state.update(),
@@ -1949,7 +1949,7 @@ impl State {
19491949
shell.move_current_window(
19501950
seat,
19511951
&current_output,
1952-
(&current_output, Some(workspace as usize)),
1952+
(&current_output, Some(workspace)),
19531953
matches!(x, Action::MoveToPreviousWorkspace),
19541954
direction,
19551955
&mut self.common.workspace_state.update(),

src/shell/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2628,7 +2628,7 @@ impl Shell {
26282628
seat,
26292629
initial_window_location,
26302630
cursor_output,
2631-
active_hint as u8,
2631+
active_hint,
26322632
layer,
26332633
release,
26342634
evlh.clone(),

src/wayland/handlers/screencopy/render.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ where
8080
if matches!(buffer_type(&buffer), Some(BufferType::Shm)) {
8181
let buffer_size = buffer_dimensions(&buffer).unwrap();
8282
if let Err(err) = with_buffer_contents_mut(&buffer, |ptr, len, data| {
83-
let offset = data.offset as i32;
84-
let width = data.width as i32;
85-
let height = data.height as i32;
86-
let stride = data.stride as i32;
83+
let offset = data.offset;
84+
let width = data.width;
85+
let height = data.height;
86+
let stride = data.stride;
8787
let format = shm_format_to_fourcc(data.format)
8888
.expect("We should be able to convert all hardcoded shm screencopy formats");
8989

src/wayland/handlers/toplevel_management.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl ToplevelManagementHandler for State {
5555

5656
let res = shell.activate(
5757
&output,
58-
idx as usize,
58+
idx,
5959
WorkspaceDelta::new_shortcut(),
6060
&mut self.common.workspace_state.update(),
6161
);

src/xwayland.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl Common {
254254
.outputs()
255255
.map(|o| o.current_scale().integer_scale())
256256
.max()
257-
.unwrap_or(1) as i32
257+
.unwrap_or(1)
258258
} else {
259259
1
260260
};

0 commit comments

Comments
 (0)