Fix clippy issues, plus a few manual cleanups

* Run `cargo clippy --fix`
*  `BackendSelector` is easier to instantiate with auto `Default`
This commit is contained in:
Yuri Astrakhan 2025-02-06 01:14:02 -05:00 committed by Olivier Goffart
parent 417eaeb38a
commit 5356fdcf89
57 changed files with 374 additions and 454 deletions

View file

@ -46,7 +46,7 @@ fn widget_library() -> &'static [(&'static str, &'static BuiltinDirectory<'stati
fn process_style(cargo_manifest_dir: &Path, path: &Path) -> std::io::Result<String> {
let library_files: Vec<PathBuf> = cargo_manifest_dir
.join(&path)
.join(path)
.read_dir()?
.filter_map(Result::ok)
.filter(|entry| {
@ -71,7 +71,7 @@ fn process_style(cargo_manifest_dir: &Path, path: &Path) -> std::io::Result<Stri
format!(
"&BuiltinFile {{path: r#\"{}\"# , contents: include_bytes!(concat!(env!(\"CARGO_MANIFEST_DIR\"), r#\"/{}\"#))}}",
file.file_name().unwrap().to_string_lossy(),
file.strip_prefix(&cargo_manifest_dir).unwrap().display()
file.strip_prefix(cargo_manifest_dir).unwrap().display()
)
})
.collect::<Vec<_>>()

View file

@ -105,7 +105,7 @@ fn load_component(component: &Rc<i_slint_compiler::object_tree::Component>) -> C
"focus".into(),
PropertyInfo {
ty: Type::Function(Rc::new(Function {
return_type: Type::Void.into(),
return_type: Type::Void,
args: vec![],
arg_names: vec![],
})),
@ -117,7 +117,7 @@ fn load_component(component: &Rc<i_slint_compiler::object_tree::Component>) -> C
"clear-focus".into(),
PropertyInfo {
ty: Type::Function(Rc::new(Function {
return_type: Type::Void.into(),
return_type: Type::Void,
args: vec![],
arg_names: vec![],
})),