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
|
x.format == format
|
||||||
&& (!needs_linear || x.modifier == u64::from(gbm::Modifier::Linear))
|
&& (!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<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
if modifiers.is_empty() {
|
if modifiers.is_empty() {
|
||||||
|
|
|
||||||
14
src/main.rs
14
src/main.rs
|
|
@ -128,7 +128,7 @@ enum Msg {
|
||||||
SourceFinished,
|
SourceFinished,
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
NewWorkspace,
|
NewWorkspace,
|
||||||
CompConfig(CosmicCompConfig),
|
CompConfig(Box<CosmicCompConfig>),
|
||||||
Config(CosmicWorkspacesConfig),
|
Config(CosmicWorkspacesConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,20 +176,12 @@ enum DragSurface {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
struct Conf {
|
struct Conf {
|
||||||
workspace_config: cosmic_comp_config::workspace::WorkspaceConfig,
|
workspace_config: cosmic_comp_config::workspace::WorkspaceConfig,
|
||||||
config: CosmicWorkspacesConfig,
|
config: CosmicWorkspacesConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Conf {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self {
|
|
||||||
workspace_config: Default::default(),
|
|
||||||
config: Default::default(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct App {
|
struct App {
|
||||||
layer_surfaces: HashMap<SurfaceId, LayerSurface>,
|
layer_surfaces: HashMap<SurfaceId, LayerSurface>,
|
||||||
|
|
@ -619,7 +611,7 @@ impl Application for App {
|
||||||
if !update.errors.is_empty() {
|
if !update.errors.is_empty() {
|
||||||
log::error!("Failed to load compositor config: {:?}", update.errors);
|
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];
|
let mut subscriptions = vec![events, config_subscription, comp_config_subscription];
|
||||||
if let Some(conn) = self.conn.clone() {
|
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()
|
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(fd) => match rustix::shm::shm_unlink(&name) {
|
||||||
Ok(_) => return Ok(fd),
|
Ok(_) => return Ok(fd),
|
||||||
Err(errno) => {
|
Err(errno) => {
|
||||||
return Err(errno.into());
|
return Err(errno);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
Err(Errno::EXIST | Errno::EXIST) => {
|
Err(Errno::EXIST | Errno::EXIST) => {
|
||||||
continue;
|
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);
|
.padding(4);
|
||||||
crate::widgets::workspace_item(
|
crate::widgets::workspace_item(
|
||||||
vec![
|
vec![
|
||||||
close_button(Msg::CloseToplevel(toplevel.handle.clone())).into(),
|
close_button(Msg::CloseToplevel(toplevel.handle.clone())),
|
||||||
widget::button(capture_image(toplevel.img.as_ref()))
|
widget::button(capture_image(toplevel.img.as_ref()))
|
||||||
.selected(
|
.selected(
|
||||||
toplevel
|
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 {
|
Toplevels {
|
||||||
axis: Axis::Horizontal,
|
axis: Axis::Horizontal,
|
||||||
children,
|
children,
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,7 @@ impl AxisExt for Axis {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn workspace_bar<'a, Msg>(
|
pub fn workspace_bar<Msg>(children: Vec<cosmic::Element<Msg>>, axis: Axis) -> WorkspaceBar<Msg> {
|
||||||
children: Vec<cosmic::Element<'a, Msg>>,
|
|
||||||
axis: Axis,
|
|
||||||
) -> WorkspaceBar<'a, Msg> {
|
|
||||||
WorkspaceBar {
|
WorkspaceBar {
|
||||||
axis,
|
axis,
|
||||||
children,
|
children,
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,7 @@ impl AxisExt for Axis {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn workspace_item<'a, Msg>(
|
pub fn workspace_item<Msg>(children: Vec<cosmic::Element<Msg>>, axis: Axis) -> WorkspaceItem<Msg> {
|
||||||
children: Vec<cosmic::Element<'a, Msg>>,
|
|
||||||
axis: Axis,
|
|
||||||
) -> WorkspaceItem<'a, Msg> {
|
|
||||||
WorkspaceItem {
|
WorkspaceItem {
|
||||||
axis,
|
axis,
|
||||||
children,
|
children,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue