Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Nov 6, 2023
1 parent 9ff1e7b commit e754dcc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/libs/core/src/imp/factory_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
}
}
2 changes: 1 addition & 1 deletion crates/libs/core/src/strings/pcstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() }));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/implement/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
11 changes: 5 additions & 6 deletions crates/tools/msvc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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()
Expand All @@ -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();
Expand Down

0 comments on commit e754dcc

Please sign in to comment.