Skip to content

Commit b3d8e0d

Browse files
StantonMattbbqsrc
authored andcommitted
Fix beta clippy format borrow warnings
Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
1 parent e9fd58e commit b3d8e0d

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

src/cargo.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use cargo_metadata::{Artifact, Message, semver::Version};
1313
use crate::{ARCH, clang_target, ndk_tool, shell::Shell, sysroot_suffix, sysroot_target};
1414

1515
fn cargo_env_target_cfg(triple: &str, key: &str) -> String {
16-
format!("CARGO_TARGET_{}_{}", &triple.replace('-', "_"), key).to_uppercase()
16+
format!("CARGO_TARGET_{}_{}", triple.replace('-', "_"), key).to_uppercase()
1717
}
1818

1919
#[inline]
@@ -100,7 +100,7 @@ pub(crate) fn build_env(
100100
let cargo_ar_key = cargo_env_target_cfg(triple, "ar");
101101
let cargo_linker_key = cargo_env_target_cfg(triple, "linker");
102102
let cargo_runner_key = cargo_env_target_cfg(triple, "runner");
103-
let bindgen_clang_args_key = format!("BINDGEN_EXTRA_CLANG_ARGS_{}", &triple.replace('-', "_"));
103+
let bindgen_clang_args_key = format!("BINDGEN_EXTRA_CLANG_ARGS_{}", triple.replace('-', "_"));
104104

105105
let target_cc = ndk_home.join(ndk_tool(ARCH, "clang"));
106106
let target_cflags = match cflags_value {
@@ -123,8 +123,8 @@ pub(crate) fn build_env(
123123

124124
let extra_include = format!(
125125
"{}/usr/include/{}",
126-
&cargo_ndk_sysroot_path.display(),
127-
&cargo_ndk_sysroot_target
126+
cargo_ndk_sysroot_path.display(),
127+
cargo_ndk_sysroot_target
128128
);
129129

130130
let mut envs = [
@@ -218,7 +218,7 @@ pub(crate) fn build_env(
218218

219219
let bindgen_args = format!(
220220
"--sysroot={} -I{}",
221-
&cargo_ndk_sysroot_path.display(),
221+
cargo_ndk_sysroot_path.display(),
222222
extra_include
223223
);
224224
let bindgen_clang_args = bindgen_args.replace('\\', "/");

src/cli/mod.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ pub fn run(args: Vec<String>) -> anyhow::Result<()> {
537537
shell.very_verbose(|shell| {
538538
shell.status_with_color(
539539
"Exporting",
540-
format!("CARGO_NDK_CMAKE_TOOLCHAIN_PATH={:?}", &cmake_toolchain_path),
540+
format!("CARGO_NDK_CMAKE_TOOLCHAIN_PATH={:?}", cmake_toolchain_path),
541541
termcolor::Color::Cyan,
542542
)
543543
})?;
@@ -619,12 +619,12 @@ pub fn run(args: Vec<String>) -> anyhow::Result<()> {
619619
.into_iter()
620620
.map(|target| {
621621
let triple = target.triple();
622-
shell.status("Building", format!("{} ({})", &target, &triple))?;
622+
shell.status("Building", format!("{} ({})", target, triple))?;
623623

624624
shell.very_verbose(|shell| {
625625
shell.status_with_color(
626626
"Exporting",
627-
format!("CARGO_NDK_ANDROID_PLATFORM={:?}", &target.to_string()),
627+
format!("CARGO_NDK_ANDROID_PLATFORM={:?}", target.to_string()),
628628
termcolor::Color::Cyan,
629629
)
630630
})?;
@@ -649,7 +649,7 @@ pub fn run(args: Vec<String>) -> anyhow::Result<()> {
649649
shell.very_verbose(|shell| {
650650
shell.status_with_color(
651651
"Exporting",
652-
format!("ANDROID_ABI={:?}", &android_abi),
652+
format!("ANDROID_ABI={:?}", android_abi),
653653
termcolor::Color::Cyan,
654654
)
655655
})?;
@@ -737,10 +737,7 @@ pub fn run(args: Vec<String>) -> anyhow::Result<()> {
737737
shell.verbose(|shell| shell.status("Fresh", "libc++_shared.so"))?;
738738
} else {
739739
shell.verbose(|shell| {
740-
shell.status(
741-
"Copying",
742-
format!("libc++_shared.so -> {}", &dest.display()),
743-
)
740+
shell.status("Copying", format!("libc++_shared.so -> {}", dest.display()))
744741
})?;
745742

746743
fs::copy(cargo_ndk_sysroot_libs_path.join("libc++_shared.so"), &dest)
@@ -778,7 +775,7 @@ pub fn run(args: Vec<String>) -> anyhow::Result<()> {
778775
}
779776

780777
shell.verbose(|shell| {
781-
shell.status("Copying", format!("{file} -> {}", &dest.display()))
778+
shell.status("Copying", format!("{file} -> {}", dest.display()))
782779
})?;
783780

784781
fs::copy(file, &dest)

src/cli/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub fn run(args: Vec<String>) -> anyhow::Result<()> {
148148
shell.verbose(|shell| {
149149
shell.status_with_color(
150150
"Building",
151-
format!("test binary for {} ({})", &target, &triple),
151+
format!("test binary for {} ({})", target, triple),
152152
termcolor::Color::Cyan,
153153
)
154154
})?;

0 commit comments

Comments
 (0)