mirror of
https://github.com/YaLTeR/niri.git
synced 2024-09-20 16:58:36 +03:00
Fix Clippy warnings
This commit is contained in:
parent
1706a46b2b
commit
3dc4a5fdac
@ -98,7 +98,7 @@ impl Backend {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> Result<(), ()> {
|
||||
pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> bool {
|
||||
match self {
|
||||
Backend::Tty(tty) => tty.import_dmabuf(dmabuf),
|
||||
Backend::Winit(winit) => winit.import_dmabuf(dmabuf),
|
||||
|
@ -1113,20 +1113,20 @@ impl Tty {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> Result<(), ()> {
|
||||
pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> bool {
|
||||
let mut renderer = match self.gpu_manager.single_renderer(&self.primary_render_node) {
|
||||
Ok(renderer) => renderer,
|
||||
Err(err) => {
|
||||
debug!("error creating renderer for primary GPU: {err:?}");
|
||||
return Err(());
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
match renderer.import_dmabuf(dmabuf, None) {
|
||||
Ok(_texture) => Ok(()),
|
||||
Ok(_texture) => true,
|
||||
Err(err) => {
|
||||
debug!("error importing dmabuf: {err:?}");
|
||||
Err(())
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -211,12 +211,12 @@ impl Winit {
|
||||
renderer.set_debug_flags(renderer.debug_flags() ^ DebugFlags::TINT);
|
||||
}
|
||||
|
||||
pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> Result<(), ()> {
|
||||
pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> bool {
|
||||
match self.backend.renderer().import_dmabuf(dmabuf, None) {
|
||||
Ok(_texture) => Ok(()),
|
||||
Ok(_texture) => true,
|
||||
Err(err) => {
|
||||
debug!("error importing dmabuf: {err:?}");
|
||||
Err(())
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,6 +167,12 @@ impl ConfigErrorNotification {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ConfigErrorNotification {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn render(scale: i32, created_path: Option<&Path>) -> anyhow::Result<MemoryRenderBuffer> {
|
||||
let _span = tracy_client::span!("config_error_notification::render");
|
||||
|
||||
|
@ -229,13 +229,10 @@ impl DmabufHandler for State {
|
||||
dmabuf: Dmabuf,
|
||||
notifier: ImportNotifier,
|
||||
) {
|
||||
match self.backend.import_dmabuf(&dmabuf) {
|
||||
Ok(_) => {
|
||||
let _ = notifier.successful::<State>();
|
||||
}
|
||||
Err(_) => {
|
||||
notifier.failed();
|
||||
}
|
||||
if self.backend.import_dmabuf(&dmabuf) {
|
||||
let _ = notifier.successful::<State>();
|
||||
} else {
|
||||
notifier.failed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user