From d345ce3ec55513dc93e25d85f73eb5c8f9e39716 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 19 May 2023 11:12:24 -0500 Subject: [PATCH] style: Make clippy happy --- examples/example_fixture.rs | 3 ++- src/bin/bin_fixture.rs | 3 ++- src/format/mod.rs | 1 + tests/build.rs | 2 +- tests/run.rs | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/example_fixture.rs b/examples/example_fixture.rs index 3e025d2..f47540f 100644 --- a/examples/example_fixture.rs +++ b/examples/example_fixture.rs @@ -15,7 +15,8 @@ fn run() -> Result<(), Box> { let code = env::var("exit") .ok() .map(|v| v.parse::()) - .map_or(Ok(None), |r| r.map(Some))? + .map(|r| r.map(Some)) + .unwrap_or(Ok(None))? .unwrap_or(0); process::exit(code); } diff --git a/src/bin/bin_fixture.rs b/src/bin/bin_fixture.rs index 3e025d2..f47540f 100644 --- a/src/bin/bin_fixture.rs +++ b/src/bin/bin_fixture.rs @@ -15,7 +15,8 @@ fn run() -> Result<(), Box> { let code = env::var("exit") .ok() .map(|v| v.parse::()) - .map_or(Ok(None), |r| r.map(Some))? + .map(|r| r.map(Some)) + .unwrap_or(Ok(None))? .unwrap_or(0); process::exit(code); } diff --git a/src/format/mod.rs b/src/format/mod.rs index 6ecda37..9c96861 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -14,6 +14,7 @@ type CowStr<'a> = borrow::Cow<'a, str>; /// A cargo message #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "reason", rename_all = "kebab-case")] +#[allow(clippy::large_enum_variant)] pub enum Message<'a> { /// Build completed, all further output should not be parsed BuildFinished(BuildFinished), diff --git a/tests/build.rs b/tests/build.rs index 0572532..d5e03a2 100644 --- a/tests/build.rs +++ b/tests/build.rs @@ -2,7 +2,7 @@ fn test_fixture(name: &str) { let temp = assert_fs::TempDir::new().unwrap(); let msgs = escargot::CargoBuild::new() - .manifest_path(&format!("tests/fixtures/{}/Cargo.toml", name)) + .manifest_path(format!("tests/fixtures/{}/Cargo.toml", name)) .current_release() .current_target() .target_dir(temp.path()) diff --git a/tests/run.rs b/tests/run.rs index c1dbdc5..cef927a 100644 --- a/tests/run.rs +++ b/tests/run.rs @@ -2,7 +2,7 @@ fn test_fixture(name: &str) { let temp = assert_fs::TempDir::new().unwrap(); let cmd = escargot::CargoBuild::new() - .manifest_path(&format!("tests/fixtures/{}/Cargo.toml", name)) + .manifest_path(format!("tests/fixtures/{}/Cargo.toml", name)) .current_release() .current_target() .target_dir(temp.path())