Fix clippy lints
This commit is contained in:
parent
3dd5a28e28
commit
7997d58ce7
7 changed files with 11 additions and 25 deletions
|
|
@ -99,7 +99,7 @@ impl AppData {
|
|||
x.format == format
|
||||
&& (!needs_linear || x.modifier == u64::from(gbm::Modifier::Linear))
|
||||
})
|
||||
.filter_map(|x| gbm::Modifier::try_from(x.modifier).ok())
|
||||
.map(|x| gbm::Modifier::from(x.modifier))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if modifiers.is_empty() {
|
||||
|
|
|
|||
14
src/main.rs
14
src/main.rs
|
|
@ -128,7 +128,7 @@ enum Msg {
|
|||
SourceFinished,
|
||||
#[allow(dead_code)]
|
||||
NewWorkspace,
|
||||
CompConfig(CosmicCompConfig),
|
||||
CompConfig(Box<CosmicCompConfig>),
|
||||
Config(CosmicWorkspacesConfig),
|
||||
}
|
||||
|
||||
|
|
@ -176,20 +176,12 @@ enum DragSurface {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct Conf {
|
||||
workspace_config: cosmic_comp_config::workspace::WorkspaceConfig,
|
||||
config: CosmicWorkspacesConfig,
|
||||
}
|
||||
|
||||
impl Default for Conf {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
workspace_config: Default::default(),
|
||||
config: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct App {
|
||||
layer_surfaces: HashMap<SurfaceId, LayerSurface>,
|
||||
|
|
@ -619,7 +611,7 @@ impl Application for App {
|
|||
if !update.errors.is_empty() {
|
||||
log::error!("Failed to load compositor config: {:?}", update.errors);
|
||||
}
|
||||
Msg::CompConfig(update.config)
|
||||
Msg::CompConfig(Box::new(update.config))
|
||||
});
|
||||
let mut subscriptions = vec![events, config_subscription, comp_config_subscription];
|
||||
if let Some(conn) = self.conn.clone() {
|
||||
|
|
|
|||
|
|
@ -34,18 +34,18 @@ pub fn create_memfile() -> rustix::io::Result<OwnedFd> {
|
|||
time.duration_since(UNIX_EPOCH).unwrap().subsec_nanos()
|
||||
);
|
||||
|
||||
match rustix::shm::shm_open(&name, flags, 0600.into()) {
|
||||
match rustix::shm::shm_open(&name, flags, 0o600.into()) {
|
||||
Ok(fd) => match rustix::shm::shm_unlink(&name) {
|
||||
Ok(_) => return Ok(fd),
|
||||
Err(errno) => {
|
||||
return Err(errno.into());
|
||||
return Err(errno);
|
||||
}
|
||||
},
|
||||
#[allow(unreachable_patterns)]
|
||||
Err(Errno::EXIST | Errno::EXIST) => {
|
||||
continue;
|
||||
}
|
||||
Err(err) => return Err(err.into()),
|
||||
Err(errno) => return Err(errno),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ pub(crate) fn toplevel_preview(toplevel: &Toplevel) -> cosmic::Element<Msg> {
|
|||
.padding(4);
|
||||
crate::widgets::workspace_item(
|
||||
vec![
|
||||
close_button(Msg::CloseToplevel(toplevel.handle.clone())).into(),
|
||||
close_button(Msg::CloseToplevel(toplevel.handle.clone())),
|
||||
widget::button(capture_image(toplevel.img.as_ref()))
|
||||
.selected(
|
||||
toplevel
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ impl AxisExt for Axis {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn toplevels<'a, Msg>(children: Vec<cosmic::Element<'a, Msg>>) -> Toplevels<'a, Msg> {
|
||||
pub fn toplevels<Msg>(children: Vec<cosmic::Element<Msg>>) -> Toplevels<Msg> {
|
||||
Toplevels {
|
||||
axis: Axis::Horizontal,
|
||||
children,
|
||||
|
|
|
|||
|
|
@ -43,10 +43,7 @@ impl AxisExt for Axis {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn workspace_bar<'a, Msg>(
|
||||
children: Vec<cosmic::Element<'a, Msg>>,
|
||||
axis: Axis,
|
||||
) -> WorkspaceBar<'a, Msg> {
|
||||
pub fn workspace_bar<Msg>(children: Vec<cosmic::Element<Msg>>, axis: Axis) -> WorkspaceBar<Msg> {
|
||||
WorkspaceBar {
|
||||
axis,
|
||||
children,
|
||||
|
|
|
|||
|
|
@ -45,10 +45,7 @@ impl AxisExt for Axis {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn workspace_item<'a, Msg>(
|
||||
children: Vec<cosmic::Element<'a, Msg>>,
|
||||
axis: Axis,
|
||||
) -> WorkspaceItem<'a, Msg> {
|
||||
pub fn workspace_item<Msg>(children: Vec<cosmic::Element<Msg>>, axis: Axis) -> WorkspaceItem<Msg> {
|
||||
WorkspaceItem {
|
||||
axis,
|
||||
children,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue