From 251bd491b581f3d8f4b6857517e191a4ae953e13 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 7 Jan 2025 01:24:43 +1100 Subject: [PATCH] Fix clippy warnings (#1346) Signed-off-by: Jiahao XU --- .../wasm32-wasip1-threads-test/src/main.rs | 1 + src/flags.rs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dev-tools/wasm32-wasip1-threads-test/src/main.rs b/dev-tools/wasm32-wasip1-threads-test/src/main.rs index 0181b84d..47b30695 100644 --- a/dev-tools/wasm32-wasip1-threads-test/src/main.rs +++ b/dev-tools/wasm32-wasip1-threads-test/src/main.rs @@ -2,6 +2,7 @@ use rusqlite::{Connection, Result}; #[derive(Debug)] struct Person { + #[allow(unused)] pub id: i32, pub name: String, pub data: Option>, diff --git a/src/flags.rs b/src/flags.rs index 21a929c9..8b0d7563 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -313,7 +313,7 @@ mod tests { #[test] fn codegen_type() { let expected = RustcCodegenFlags { - code_model: Some("tiny".into()), + code_model: Some("tiny"), ..RustcCodegenFlags::default() }; check("-Ccode-model=tiny", &expected); @@ -327,7 +327,7 @@ mod tests { check( "-ccode-model=tiny\u{1f}-Ccode-model=small", &RustcCodegenFlags { - code_model: Some("small".into()), + code_model: Some("small"), ..RustcCodegenFlags::default() }, ); @@ -342,7 +342,7 @@ mod tests { #[test] fn three_valid_prefixes() { let expected = RustcCodegenFlags { - lto: Some("true".into()), + lto: Some("true"), ..RustcCodegenFlags::default() }; check("-L\u{1f}-L\u{1f}-Clto", &expected); @@ -460,20 +460,20 @@ mod tests { check( &flags.join("\u{1f}"), &RustcCodegenFlags { - code_model: Some("tiny".into()), - control_flow_guard: Some("yes".into()), + code_model: Some("tiny"), + control_flow_guard: Some("yes"), embed_bitcode: Some(false), force_frame_pointers: Some(true), link_dead_code: Some(true), - lto: Some("false".into()), + lto: Some("false"), no_redzone: Some(true), no_vectorize_loops: true, no_vectorize_slp: true, - profile_generate: Some("fooprofile".into()), - profile_use: Some("fooprofile".into()), - relocation_model: Some("pic".into()), + profile_generate: Some("fooprofile"), + profile_use: Some("fooprofile"), + relocation_model: Some("pic"), soft_float: Some(true), - branch_protection: Some("bti,pac-ret,leaf".into()), + branch_protection: Some("bti,pac-ret,leaf"), }, ); }