Skip to content

Commit 11f3b37

Browse files
kulpemilio
authored andcommitted
Fix some clippy warnings
cargo clippy --fix --tests cargo +nightly fmt
1 parent 24252f0 commit 11f3b37

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ fn main() {
8585
);
8686
println!(
8787
"cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_{}",
88-
std::env::var("TARGET").unwrap().replace("-", "_")
88+
std::env::var("TARGET").unwrap().replace('-', "_")
8989
);
9090
}

src/codegen/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4095,9 +4095,7 @@ fn objc_method_codegen(
40954095

40964096
let body = if method.is_class_method() {
40974097
let class_name = ctx.rust_ident(
4098-
class_name
4099-
.expect("Generating a class method without class name?")
4100-
.to_owned(),
4098+
class_name.expect("Generating a class method without class name?"),
41014099
);
41024100
quote! {
41034101
msg_send!(class!(#class_name), #methods_and_args)

src/ir/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
597597
/// Returns the pointer width to use for the target for the current
598598
/// translation.
599599
pub fn target_pointer_size(&self) -> usize {
600-
return self.target_info.pointer_width / 8;
600+
self.target_info.pointer_width / 8
601601
}
602602

603603
/// Get the stack of partially parsed types that we are in the middle of
@@ -836,9 +836,9 @@ If you encounter an error missing from this list, please file an issue or a PR!"
836836
)
837837
{
838838
let mut s = name.to_owned();
839-
s = s.replace("@", "_");
840-
s = s.replace("?", "_");
841-
s = s.replace("$", "_");
839+
s = s.replace('@', "_");
840+
s = s.replace('?', "_");
841+
s = s.replace('$', "_");
842842
s.push('_');
843843
return Cow::Owned(s);
844844
}

src/ir/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ impl ClangItemParser for Item {
18991899

19001900
// See tests/headers/const_tparam.hpp and
19011901
// tests/headers/variadic_tname.hpp.
1902-
let name = ty_spelling.replace("const ", "").replace(".", "");
1902+
let name = ty_spelling.replace("const ", "").replace('.', "");
19031903

19041904
let id = with_id.unwrap_or_else(|| ctx.next_item_id());
19051905
let item = Item::new(

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,7 @@ fn get_target_dependent_env_var(var: &str) -> Option<String> {
27142714
return Some(v);
27152715
}
27162716
if let Ok(v) =
2717-
env::var(&format!("{}_{}", var, target.replace("-", "_")))
2717+
env::var(&format!("{}_{}", var, target.replace('-', "_")))
27182718
{
27192719
return Some(v);
27202720
}

0 commit comments

Comments
 (0)