diff --git a/crates/libs/core/src/imp/factory_cache.rs b/crates/libs/core/src/imp/factory_cache.rs index 0aef2ff822..b36ab42ab3 100644 --- a/crates/libs/core/src/imp/factory_cache.rs +++ b/crates/libs/core/src/imp/factory_cache.rs @@ -155,7 +155,7 @@ mod tests { results.push(unsafe { library.to_string().unwrap() }); crate::Result::<()>::Err(crate::Error::OK) }); - assert!(matches!(end_result, None)); + assert!(end_result.is_none()); assert_eq!(results, vec!["A.B.dll", "A.dll"]); } } diff --git a/crates/libs/core/src/strings/pcstr.rs b/crates/libs/core/src/strings/pcstr.rs index 7f7018d275..161db28785 100644 --- a/crates/libs/core/src/strings/pcstr.rs +++ b/crates/libs/core/src/strings/pcstr.rs @@ -66,7 +66,7 @@ mod tests { #[test] fn can_display() { // 💖 followed by an invalid byte sequence and then an incomplete one - let s = vec![240, 159, 146, 150, 255, 240, 159, 0]; + let s = [240, 159, 146, 150, 255, 240, 159, 0]; let s = PCSTR::from_raw(s.as_ptr()); assert_eq!("💖�", format!("{}", unsafe { s.display() })); } diff --git a/crates/libs/implement/src/lib.rs b/crates/libs/implement/src/lib.rs index 095a854d38..a6b588b334 100644 --- a/crates/libs/implement/src/lib.rs +++ b/crates/libs/implement/src/lib.rs @@ -5,7 +5,7 @@ pub fn implement(attributes: proc_macro::TokenStream, original_type: proc_macro: let attributes = syn::parse_macro_input!(attributes as ImplementAttributes); let interfaces_len = proc_macro2::Literal::usize_unsuffixed(attributes.implement.len()); - let identity_type = if let Some(first) = attributes.implement.get(0) { + let identity_type = if let Some(first) = attributes.implement.first() { first.to_ident() } else { quote! { ::windows::core::IInspectable } diff --git a/crates/tools/msvc/src/main.rs b/crates/tools/msvc/src/main.rs index e5744b8444..a3a7d8e8a6 100644 --- a/crates/tools/msvc/src/main.rs +++ b/crates/tools/msvc/src/main.rs @@ -343,15 +343,14 @@ fn test_make_reproducible() { for (machine, offset) in [("x86", 0), ("x64", 12), ("arm64", 12)] { let mut def = std::fs::File::create("test.def").unwrap(); def.write_all( - format!( - r#" + r#" LIBRARY long-library-name-for-placement-in-long-names-table.dll EXPORTS A=A.#1 B=B.#2 C=C.#3 "# - ) + .to_string() .as_bytes(), ) .unwrap(); @@ -361,8 +360,8 @@ C=C.#3 cmd.arg("/nologo"); cmd.arg("/Brepro"); cmd.arg(format!("/machine:{machine}")); - cmd.arg(format!("/out:test.lib")); - cmd.arg(format!("/def:test.def")); + cmd.arg("/out:test.lib"); + cmd.arg("/def:test.def"); cmd.output().unwrap(); let mut archive = std::fs::File::options() @@ -373,7 +372,7 @@ C=C.#3 let mut buf = [0; 24]; - make_reproducible(&std::path::Path::new("test.lib")); + make_reproducible(std::path::Path::new("test.lib")); // Archive member header timestamp archive.seek(SeekFrom::Start(0x18)).unwrap();