Skip to content

Commit

Permalink
Remove unnecessary casting
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbraha authored and Drakulix committed Sep 3, 2024
1 parent 48ae9a2 commit 52280e9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/backend/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ impl WinitState {
.get::<RefCell<OutputConfig>>()
.unwrap()
.borrow_mut();
if dbg!(config.mode.0) != dbg!((size.w as i32, size.h as i32)) {
if dbg!(config.mode.0) != dbg!((size.w, size.h)) {
if !test_only {
config.mode = ((size.w as i32, size.h as i32), None);
config.mode = ((size.w, size.h), None);
}
Err(anyhow::anyhow!("Cannot set window size"))
} else {
Expand Down Expand Up @@ -143,7 +143,7 @@ pub fn init_backend(
model: name.clone(),
};
let mode = Mode {
size: (size.w as i32, size.h as i32).into(),
size: (size.w, size.h).into(),
refresh: 60_000,
};
let output = Output::new(name, props);
Expand All @@ -157,7 +157,7 @@ pub fn init_backend(
);
output.user_data().insert_if_missing(|| {
RefCell::new(OutputConfig {
mode: ((size.w as i32, size.h as i32), None),
mode: ((size.w, size.h), None),
transform: Transform::Flipped180.into(),
..Default::default()
})
Expand Down
6 changes: 3 additions & 3 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,7 @@ impl State {
let res = shell.move_current_window(
seat,
&current_output,
(&current_output, Some(workspace as usize)),
(&current_output, Some(workspace)),
matches!(x, Action::MoveToLastWorkspace),
None,
&mut self.common.workspace_state.update(),
Expand All @@ -1904,7 +1904,7 @@ impl State {
shell.move_current_window(
seat,
&current_output,
(&current_output, Some(workspace as usize)),
(&current_output, Some(workspace)),
matches!(x, Action::MoveToNextWorkspace),
direction,
&mut self.common.workspace_state.update(),
Expand Down Expand Up @@ -1949,7 +1949,7 @@ impl State {
shell.move_current_window(
seat,
&current_output,
(&current_output, Some(workspace as usize)),
(&current_output, Some(workspace)),
matches!(x, Action::MoveToPreviousWorkspace),
direction,
&mut self.common.workspace_state.update(),
Expand Down
2 changes: 1 addition & 1 deletion src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,7 @@ impl Shell {
seat,
initial_window_location,
cursor_output,
active_hint as u8,
active_hint,
layer,
release,
evlh.clone(),
Expand Down
8 changes: 4 additions & 4 deletions src/wayland/handlers/screencopy/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ where
if matches!(buffer_type(&buffer), Some(BufferType::Shm)) {
let buffer_size = buffer_dimensions(&buffer).unwrap();
if let Err(err) = with_buffer_contents_mut(&buffer, |ptr, len, data| {
let offset = data.offset as i32;
let width = data.width as i32;
let height = data.height as i32;
let stride = data.stride as i32;
let offset = data.offset;
let width = data.width;
let height = data.height;
let stride = data.stride;
let format = shm_format_to_fourcc(data.format)
.expect("We should be able to convert all hardcoded shm screencopy formats");

Expand Down
2 changes: 1 addition & 1 deletion src/wayland/handlers/toplevel_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ToplevelManagementHandler for State {

let res = shell.activate(
&output,
idx as usize,
idx,
WorkspaceDelta::new_shortcut(),
&mut self.common.workspace_state.update(),
);
Expand Down
2 changes: 1 addition & 1 deletion src/xwayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl Common {
.outputs()
.map(|o| o.current_scale().integer_scale())
.max()
.unwrap_or(1) as i32
.unwrap_or(1)
} else {
1
};
Expand Down

0 comments on commit 52280e9

Please sign in to comment.