Skip to content

Commit 95dacb5

Browse files
authored
Fix lint errors on newer Rust (#778)
Fixes: ``` warning: this `continue` expression is redundant --> shared-test/src/lib.rs:52:21 | 52 | continue; | ^^^^^^^^ | = help: consider dropping the `continue` expression = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue = note: `-W clippy::needless-continue` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_continue)]` warning: unnecessary semicolon --> buildpacks/jvm-function-invoker/src/error.rs:115:6 | 115 | }; | ^ help: remove | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon = note: `-W clippy::unnecessary-semicolon` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_semicolon)]` warning: unnecessary semicolon --> buildpacks/jvm-function-invoker/src/layers/bundle.rs:60:6 | 60 | }; | ^ help: remove | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon warning: `buildpacks-jvm-shared-test` (lib) generated 1 warning warning: `buildpacks-jvm-shared-test` (lib test) generated 1 warning (1 duplicate) warning: `buildpack-heroku-jvm-function-invoker` (bin "buildpack-heroku-jvm-function-invoker") generated 2 warnings (run `cargo clippy --fix --bin "buildpack-heroku-jvm-function-invoker"` to apply 2 suggestions) warning: this `map_or` can be simplified --> buildpacks/jvm/src/bin/heroku_database_env_var_rewrite.rs:43:45 | 43 | let disable_spring_datasource_url = input | _____________________________________________^ 44 | | .get("DISABLE_SPRING_DATASOURCE_URL") 45 | | .map_or(false, |value| value == "true"); | |___________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or = note: `#[warn(clippy::unnecessary_map_or)]` on by default help: use is_some_and instead | 45 - .map_or(false, |value| value == "true"); 45 + .is_some_and(|value| value == "true"); | warning: unnecessary semicolon --> buildpacks/jvm/src/bin/heroku_database_env_var_rewrite.rs:127:6 | 127 | }; | ^ help: remove | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon = note: `-W clippy::unnecessary-semicolon` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_semicolon)]` ```
1 parent 581ec12 commit 95dacb5

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

buildpacks/jvm-function-invoker/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ pub(crate) fn handle_buildpack_error(error: JvmFunctionInvokerBuildpackError) {
112112
"},
113113
),
114114
},
115-
};
115+
}
116116
}

buildpacks/jvm-function-invoker/src/layers/bundle.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub(crate) fn handle_bundle(
5757
Some(2) => Err(BundleLayerError::MultipleFunctionsFound)?,
5858
Some(code) => Err(BundleLayerError::DetectionFailed(code))?,
5959
None => Err(BundleLayerError::UnexpectedDetectionTermination)?,
60-
};
60+
}
6161

6262
Ok(())
6363
}

buildpacks/jvm/src/bin/heroku_database_env_var_rewrite.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn jvm_env_vars_for_env(
4242
// Handling for Spring specific JDBC environment variables
4343
let disable_spring_datasource_url = input
4444
.get("DISABLE_SPRING_DATASOURCE_URL")
45-
.map_or(false, |value| value == "true");
45+
.is_some_and(|value| value == "true");
4646

4747
if !disable_spring_datasource_url
4848
&& !input.contains_key("SPRING_DATASOURCE_URL")
@@ -124,7 +124,7 @@ fn env_vars_for_database_url(
124124
url.set_scheme("postgresql")
125125
.map_err(|()| DatabaseEnvVarError::CannotSetScheme)?;
126126
url.query_pairs_mut().append_pair("sslmode", "require");
127-
};
127+
}
128128

129129
Ok(HashMap::from([
130130
(

shared-test/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ where
4949
None | Some(None) => return result,
5050
Some(Some(backoff_duration)) => {
5151
std::thread::sleep(backoff_duration);
52-
continue;
5352
}
5453
},
5554
}

0 commit comments

Comments
 (0)