Skip to content

Commit

Permalink
rust: run cargo fmt against the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
rizsotto committed Oct 20, 2024
1 parent 8157037 commit 777954d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rust/bear/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
fn main() {
println!("cargo:rustc-env=WRAPPER_EXECUTABLE_PATH=/usr/libexec/bear/wrapper");
println!("cargo:rustc-env=PRELOAD_LIBRARY_PATH=/usr/libexec/bear/$LIB/libexec.so");
}
}
2 changes: 1 addition & 1 deletion rust/bear/src/semantic/tools/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use nom::multi::many1;
use nom::sequence::preceded;

use super::super::{Meaning, RecognitionResult, Tool};
use internal::Argument;
use intercept::Execution;
use internal::Argument;

pub(super) struct Gcc {}

Expand Down
7 changes: 5 additions & 2 deletions rust/intercept/src/bin/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ fn main() -> Result<()> {
/// will be the name of the soft link. This function returns the file name
/// of the soft link.
fn file_name_from_arguments() -> Result<PathBuf> {
std::env::args().next()
std::env::args()
.next()
.ok_or_else(|| anyhow::anyhow!("Cannot get first argument"))
.and_then(|arg| match PathBuf::from(arg).file_name() {
Some(file_name) => Ok(PathBuf::from(file_name)),
None => Err(anyhow::anyhow!("Cannot get the file name from the argument")),
None => Err(anyhow::anyhow!(
"Cannot get the file name from the argument"
)),
})
}

Expand Down

0 comments on commit 777954d

Please sign in to comment.