Skip to content

Commit ecb17ee

Browse files
petehayes102Jan Diederich
authored andcommitted
Appease clippy
1 parent 4239e4c commit ecb17ee

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ fn main() {
2424
.write_all(commit_info().as_bytes())
2525
.unwrap();
2626

27+
// Add "cross_sandboxed" to list of approved cfgs
28+
println!("cargo::rustc-check-cfg=cfg(cross_sandboxed)");
29+
2730
if env::var("CROSS_SANDBOXED").is_ok() {
2831
println!("cargo:rustc-cfg=cross_sandboxed");
2932
}

src/config.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,9 @@ impl Config {
259259
for mentioned_target in keys {
260260
let mentioned_target_norm = mentioned_target
261261
.to_string()
262-
.replace(|c| c == '-' || c == '_', "")
263-
.to_lowercase();
264-
let target_norm = target
265-
.to_string()
266-
.replace(|c| c == '-' || c == '_', "")
262+
.replace(['-', '_'], "")
267263
.to_lowercase();
264+
let target_norm = target.to_string().replace(['-', '_'], "").to_lowercase();
268265
if mentioned_target != target && mentioned_target_norm == target_norm {
269266
msg_info.warn(format_args!("a target named \"{mentioned_target}\" is mentioned in the Cross configuration, but the current specified target is \"{target}\"."))?;
270267
msg_info.status(" > Is the target misspelled in the Cross configuration?")?;

src/docker/custom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ fn docker_tag_name(file_name: &str) -> String {
266266

267267
// in case our result ends in an invalid last char `-` or `.`
268268
// we remove
269-
result = result.trim_end_matches(&['.', '-']).to_owned();
269+
result = result.trim_end_matches(['.', '-']).to_owned();
270270

271271
// in case all characters were invalid or we had all non-ASCII
272272
// characters followed by a `-` or `.`, we use a non-empty filename

src/docker/remote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ symlink_recurse \"${{prefix}}\"
10011001
{
10021002
subcommand_or_exit(engine, "cp")?
10031003
.arg("-a")
1004-
.arg(&format!("{container_id}:{mount_target_dir}",))
1004+
.arg(format!("{container_id}:{mount_target_dir}",))
10051005
.arg(
10061006
package_dirs
10071007
.target()

src/docker/shared.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ pub(crate) struct ChildContainerInfo {
554554
// that the drop only gets called once, even if we have
555555
// the signal handle invoked multiple times or it fails.
556556
#[allow(missing_debug_implementations)]
557+
#[derive(Default)]
557558
pub struct ChildContainer {
558559
info: Option<ChildContainerInfo>,
559560
exists: AtomicBool,

0 commit comments

Comments
 (0)