Skip to content

Commit

Permalink
Resolve unnecessary_semicolon pedantic clippy lint
Browse files Browse the repository at this point in the history
    warning: unnecessary semicolon
      --> gen/build/src/target.rs:17:10
       |
    17 |         };
       |          ^ 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
       --> macro/src/expand.rs:729:6
        |
    729 |     };
        |      ^ 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)]`
  • Loading branch information
dtolnay committed Jan 30, 2025
1 parent 9288757 commit d47e4a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions gen/build/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ pub(crate) enum TargetDir {
pub(crate) fn find_target_dir(out_dir: &Path) -> TargetDir {
if let Some(target_dir) = env::var_os("CARGO_TARGET_DIR") {
let target_dir = PathBuf::from(target_dir);
if target_dir.is_absolute() {
return TargetDir::Path(target_dir);
return if target_dir.is_absolute() {
TargetDir::Path(target_dir)
} else {
return TargetDir::Unknown;
TargetDir::Unknown
};
}

Expand Down
2 changes: 1 addition & 1 deletion macro/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ fn expand_cxx_function_shim(efn: &ExternFn, types: &Types) -> TokenStream {
if efn.throws {
expr = quote_spanned!(span=> ::cxx::core::result::Result::Ok(#expr));
}
};
}
let dispatch = quote_spanned!(span=> unsafe { #setup #expr });
let visibility = efn.visibility;
let unsafety = &efn.sig.unsafety;
Expand Down

0 comments on commit d47e4a3

Please sign in to comment.