Fix clippy::needless_borrow lint violations (#36444)
Release Notes: - N/A
This commit is contained in:
@@ -642,7 +642,7 @@ pub(super) fn get_xkb_compose_state(cx: &xkb::Context) -> Option<xkb::compose::S
|
||||
let mut state: Option<xkb::compose::State> = None;
|
||||
for locale in locales {
|
||||
if let Ok(table) =
|
||||
xkb::compose::Table::new_from_locale(&cx, &locale, xkb::compose::COMPILE_NO_FLAGS)
|
||||
xkb::compose::Table::new_from_locale(cx, &locale, xkb::compose::COMPILE_NO_FLAGS)
|
||||
{
|
||||
state = Some(xkb::compose::State::new(
|
||||
&table,
|
||||
|
||||
@@ -1145,7 +1145,7 @@ impl Dispatch<wl_seat::WlSeat, ()> for WaylandClientStatePtr {
|
||||
.globals
|
||||
.text_input_manager
|
||||
.as_ref()
|
||||
.map(|text_input_manager| text_input_manager.get_text_input(&seat, qh, ()));
|
||||
.map(|text_input_manager| text_input_manager.get_text_input(seat, qh, ()));
|
||||
|
||||
if let Some(wl_keyboard) = &state.wl_keyboard {
|
||||
wl_keyboard.release();
|
||||
@@ -1294,7 +1294,7 @@ impl Dispatch<wl_keyboard::WlKeyboard, ()> for WaylandClientStatePtr {
|
||||
match key_state {
|
||||
wl_keyboard::KeyState::Pressed if !keysym.is_modifier_key() => {
|
||||
let mut keystroke =
|
||||
Keystroke::from_xkb(&keymap_state, state.modifiers, keycode);
|
||||
Keystroke::from_xkb(keymap_state, state.modifiers, keycode);
|
||||
if let Some(mut compose) = state.compose_state.take() {
|
||||
compose.feed(keysym);
|
||||
match compose.status() {
|
||||
@@ -1538,12 +1538,9 @@ impl Dispatch<wl_pointer::WlPointer, ()> for WaylandClientStatePtr {
|
||||
cursor_shape_device.set_shape(serial, style.to_shape());
|
||||
} else {
|
||||
let scale = window.primary_output_scale();
|
||||
state.cursor.set_icon(
|
||||
&wl_pointer,
|
||||
serial,
|
||||
style.to_icon_names(),
|
||||
scale,
|
||||
);
|
||||
state
|
||||
.cursor
|
||||
.set_icon(wl_pointer, serial, style.to_icon_names(), scale);
|
||||
}
|
||||
}
|
||||
drop(state);
|
||||
@@ -1580,7 +1577,7 @@ impl Dispatch<wl_pointer::WlPointer, ()> for WaylandClientStatePtr {
|
||||
if state
|
||||
.keyboard_focused_window
|
||||
.as_ref()
|
||||
.map_or(false, |keyboard_window| window.ptr_eq(&keyboard_window))
|
||||
.map_or(false, |keyboard_window| window.ptr_eq(keyboard_window))
|
||||
{
|
||||
state.enter_token = None;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ impl Cursor {
|
||||
hot_y as i32 / scale,
|
||||
);
|
||||
|
||||
self.surface.attach(Some(&buffer), 0, 0);
|
||||
self.surface.attach(Some(buffer), 0, 0);
|
||||
self.surface.damage(0, 0, width as i32, height as i32);
|
||||
self.surface.commit();
|
||||
}
|
||||
|
||||
@@ -1212,7 +1212,7 @@ impl X11Client {
|
||||
|
||||
state = self.0.borrow_mut();
|
||||
if let Some(mut pointer) = state.pointer_device_states.get_mut(&event.sourceid) {
|
||||
let scroll_delta = get_scroll_delta_and_update_state(&mut pointer, &event);
|
||||
let scroll_delta = get_scroll_delta_and_update_state(pointer, &event);
|
||||
drop(state);
|
||||
if let Some(scroll_delta) = scroll_delta {
|
||||
window.handle_input(PlatformInput::ScrollWheel(make_scroll_wheel_event(
|
||||
@@ -1271,7 +1271,7 @@ impl X11Client {
|
||||
Event::XinputDeviceChanged(event) => {
|
||||
let mut state = self.0.borrow_mut();
|
||||
if let Some(mut pointer) = state.pointer_device_states.get_mut(&event.sourceid) {
|
||||
reset_pointer_device_scroll_positions(&mut pointer);
|
||||
reset_pointer_device_scroll_positions(pointer);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
@@ -2038,7 +2038,7 @@ fn xdnd_get_supported_atom(
|
||||
{
|
||||
if let Some(atoms) = reply.value32() {
|
||||
for atom in atoms {
|
||||
if xdnd_is_atom_supported(atom, &supported_atoms) {
|
||||
if xdnd_is_atom_supported(atom, supported_atoms) {
|
||||
return atom;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ pub(crate) fn get_valuator_axis_index(
|
||||
// valuator present in this event's axisvalues. Axisvalues is ordered from
|
||||
// lowest valuator number to highest, so counting bits before the 1 bit for
|
||||
// this valuator yields the index in axisvalues.
|
||||
if bit_is_set_in_vec(&valuator_mask, valuator_number) {
|
||||
Some(popcount_upto_bit_index(&valuator_mask, valuator_number) as usize)
|
||||
if bit_is_set_in_vec(valuator_mask, valuator_number) {
|
||||
Some(popcount_upto_bit_index(valuator_mask, valuator_number) as usize)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ impl X11WindowState {
|
||||
.display_id
|
||||
.map_or(x_main_screen_index, |did| did.0 as usize);
|
||||
|
||||
let visual_set = find_visuals(&xcb, x_screen_index);
|
||||
let visual_set = find_visuals(xcb, x_screen_index);
|
||||
|
||||
let visual = match visual_set.transparent {
|
||||
Some(visual) => visual,
|
||||
@@ -604,7 +604,7 @@ impl X11WindowState {
|
||||
),
|
||||
)?;
|
||||
|
||||
xcb_flush(&xcb);
|
||||
xcb_flush(xcb);
|
||||
|
||||
let renderer = {
|
||||
let raw_window = RawWindow {
|
||||
@@ -664,7 +664,7 @@ impl X11WindowState {
|
||||
|| "X11 DestroyWindow failed while cleaning it up after setup failure.",
|
||||
xcb.destroy_window(x_window),
|
||||
)?;
|
||||
xcb_flush(&xcb);
|
||||
xcb_flush(xcb);
|
||||
}
|
||||
|
||||
setup_result
|
||||
|
||||
Reference in New Issue
Block a user