chore: clippy
This commit is contained in:
parent
3b70bc0265
commit
0847247c33
77 changed files with 865 additions and 1029 deletions
|
|
@ -106,8 +106,7 @@ fn try_parse_dev_from_str(val: &str) -> Option<DeviceIdentifier> {
|
|||
|
||||
let node = node
|
||||
.node_with_type(NodeType::Render)
|
||||
.map(|res| res.ok())
|
||||
.flatten()
|
||||
.and_then(|res| res.ok())
|
||||
.unwrap_or(node);
|
||||
Some(DeviceIdentifier::Node(node))
|
||||
} else if val.contains(':') {
|
||||
|
|
@ -140,8 +139,7 @@ fn try_parse_dev_from_str(val: &str) -> Option<DeviceIdentifier> {
|
|||
|
||||
let node = node
|
||||
.node_with_type(NodeType::Render)
|
||||
.map(|res| res.ok())
|
||||
.flatten()
|
||||
.and_then(|res| res.ok())
|
||||
.unwrap_or(node);
|
||||
Some(DeviceIdentifier::Node(node))
|
||||
} else {
|
||||
|
|
@ -159,8 +157,7 @@ fn try_parse_dev_from_str(val: &str) -> Option<DeviceIdentifier> {
|
|||
|
||||
let node = node
|
||||
.node_with_type(NodeType::Render)
|
||||
.map(|res| res.ok())
|
||||
.flatten()
|
||||
.and_then(|res| res.ok())
|
||||
.unwrap_or(node);
|
||||
Some(DeviceIdentifier::Node(node))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,10 +206,10 @@ impl<P: Program + Send + Clone + 'static> Clone for IcedElementInternal<P> {
|
|||
additional_scale: self.additional_scale,
|
||||
outputs: self.outputs.clone(),
|
||||
buffers: self.buffers.clone(),
|
||||
pending_realloc: self.pending_realloc.clone(),
|
||||
size: self.size.clone(),
|
||||
pending_realloc: self.pending_realloc,
|
||||
size: self.size,
|
||||
last_seat: self.last_seat.clone(),
|
||||
cursor_pos: self.cursor_pos.clone(),
|
||||
cursor_pos: self.cursor_pos,
|
||||
touch_map: self.touch_map.clone(),
|
||||
theme: self.theme.clone(),
|
||||
renderer,
|
||||
|
|
@ -632,7 +632,7 @@ impl<P: Program + Send + 'static> TouchTarget<crate::state::State> for IcedEleme
|
|||
internal.touch_map.insert(id, position);
|
||||
internal.cursor_pos = Some(event_location);
|
||||
*internal.last_seat.lock().unwrap() = Some((seat.clone(), seq));
|
||||
let _ = internal.update(false);
|
||||
internal.update(false);
|
||||
}
|
||||
|
||||
fn up(
|
||||
|
|
@ -649,7 +649,7 @@ impl<P: Program + Send + 'static> TouchTarget<crate::state::State> for IcedEleme
|
|||
internal
|
||||
.state
|
||||
.queue_event(Event::Touch(TouchEvent::FingerLifted { id, position }));
|
||||
let _ = internal.update(false);
|
||||
internal.update(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -670,7 +670,7 @@ impl<P: Program + Send + 'static> TouchTarget<crate::state::State> for IcedEleme
|
|||
.queue_event(Event::Touch(TouchEvent::FingerMoved { id, position }));
|
||||
internal.touch_map.insert(id, position);
|
||||
internal.cursor_pos = Some(event_location);
|
||||
let _ = internal.update(false);
|
||||
internal.update(false);
|
||||
}
|
||||
|
||||
fn frame(
|
||||
|
|
@ -693,7 +693,7 @@ impl<P: Program + Send + 'static> TouchTarget<crate::state::State> for IcedEleme
|
|||
.state
|
||||
.queue_event(Event::Touch(TouchEvent::FingerLost { id, position }));
|
||||
}
|
||||
let _ = internal.update(false);
|
||||
internal.update(false);
|
||||
}
|
||||
|
||||
fn shape(
|
||||
|
|
@ -771,7 +771,7 @@ impl<P: Program + Send + 'static> KeyboardTarget<crate::state::State> for IcedEl
|
|||
internal
|
||||
.state
|
||||
.queue_event(Event::Keyboard(KeyboardEvent::ModifiersChanged(mods)));
|
||||
let _ = internal.update(false);
|
||||
internal.update(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -804,7 +804,7 @@ impl<P: Program + Send + 'static> SpaceElement for IcedElement<P> {
|
|||
} else {
|
||||
WindowEvent::Unfocused
|
||||
}));
|
||||
let _ = internal.update(false);
|
||||
internal.update(false);
|
||||
}
|
||||
|
||||
fn output_enter(&self, output: &Output, _overlap: Rectangle<i32, Logical>) {
|
||||
|
|
@ -940,7 +940,7 @@ where
|
|||
.and_then(|(last_primitives, last_color)| {
|
||||
(last_color == &background_color).then(|| {
|
||||
damage::diff(
|
||||
&last_primitives,
|
||||
last_primitives,
|
||||
current_layers,
|
||||
|_| {
|
||||
vec![cosmic::iced::Rectangle::new(
|
||||
|
|
@ -1012,7 +1012,7 @@ where
|
|||
match MemoryRenderBufferRenderElement::from_buffer(
|
||||
renderer,
|
||||
location.to_f64(),
|
||||
&buffer,
|
||||
buffer,
|
||||
Some(alpha),
|
||||
Some(Rectangle::from_size(
|
||||
size.to_f64()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use cosmic_comp_config::output::comp::{AdaptiveSync, OutputConfig, OutputState};
|
|||
use smithay::{
|
||||
backend::drm::VrrSupport as Support,
|
||||
output::{Output, WeakOutput},
|
||||
utils::{Rectangle, Transform},
|
||||
utils::Rectangle,
|
||||
};
|
||||
|
||||
pub use super::geometry::*;
|
||||
|
|
@ -50,7 +50,7 @@ impl OutputExt for Output {
|
|||
|
||||
fn geometry(&self) -> Rectangle<i32, Global> {
|
||||
Rectangle::new(self.current_location(), {
|
||||
Transform::from(self.current_transform())
|
||||
self.current_transform()
|
||||
.transform_size(
|
||||
self.current_mode()
|
||||
.map(|m| m.size)
|
||||
|
|
@ -104,13 +104,12 @@ impl OutputExt for Output {
|
|||
fn adaptive_sync_support(&self) -> Option<Support> {
|
||||
self.user_data()
|
||||
.get::<VrrSupport>()
|
||||
.map(|vrr| match vrr.0.load(Ordering::SeqCst) {
|
||||
.and_then(|vrr| match vrr.0.load(Ordering::SeqCst) {
|
||||
0 => None,
|
||||
2 => Some(Support::RequiresModeset),
|
||||
3 => Some(Support::Supported),
|
||||
_ => Some(Support::NotSupported),
|
||||
})
|
||||
.flatten()
|
||||
}
|
||||
|
||||
fn set_adaptive_sync_support(&self, vrr: Option<Support>) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ pub fn screenshot_window(state: &mut State, surface: &CosmicSurface) {
|
|||
));
|
||||
let file = std::fs::File::create(path.join(name))?;
|
||||
|
||||
let ref mut writer = std::io::BufWriter::new(file);
|
||||
let writer = &mut std::io::BufWriter::new(file);
|
||||
let mut encoder = png::Encoder::new(writer, bbox.size.w as u32, bbox.size.h as u32);
|
||||
encoder.set_color(png::ColorType::Rgba);
|
||||
encoder.set_depth(png::BitDepth::Eight);
|
||||
|
|
@ -93,7 +93,7 @@ pub fn screenshot_window(state: &mut State, surface: &CosmicSurface) {
|
|||
);
|
||||
encoder.set_source_chromaticities(source_chromaticities);
|
||||
let mut writer = encoder.write_header()?;
|
||||
writer.write_image_data(&gl_data)?;
|
||||
writer.write_image_data(gl_data)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue