Skip to content

Commit

Permalink
format: Use cargo fmt
Browse files Browse the repository at this point in the history
As per the description on new pull requests, everything is formatted
with "cargo +nightly fmt --all".

Signed-off-by: Thomas Böhler <witcher@wiredspace.de>
  • Loading branch information
Witcher01 authored and kornelski committed May 19, 2024
1 parent 9e14b49 commit 5daad96
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions crev-lib/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ impl LockedId {
mem_cost: 4096,
time_cost: 192,

lanes: std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1) as u32,
lanes: std::thread::available_parallelism()
.map(|n| n.get())
.unwrap_or(1) as u32,

ad: &[],
secret: &[],
Expand Down Expand Up @@ -178,7 +180,9 @@ impl LockedId {
mem_cost: passphrase_config.memory_size,
time_cost: passphrase_config.iterations,

lanes: std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1) as u32,
lanes: std::thread::available_parallelism()
.map(|n| n.get())
.unwrap_or(1) as u32,

ad: &[],
secret: &[],
Expand Down
3 changes: 2 additions & 1 deletion crev-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ pub fn dir_verify(
trusted_set: &crev_wot::TrustSet,
requirements: &VerificationRequirements,
) -> Result<crate::VerificationStatus> {
let digest = Digest::from_bytes(&util::get_recursive_digest_for_dir(path, ignore_list)?).unwrap();
let digest =
Digest::from_bytes(&util::get_recursive_digest_for_dir(path, ignore_list)?).unwrap();
Ok(verify_package_digest(
&digest,
trusted_set,
Expand Down
16 changes: 10 additions & 6 deletions crev-lib/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,16 @@ impl Local {
.map_err(|e| Error::ReviewActivity(Box::new(e)))?;

let latest_path = self.cache_latest_review_activity_path();
crev_common::save_to_yaml_file(&latest_path, &LatestReviewActivity {
source: source.to_string(),
name: name.to_string(),
version: version.clone(),
diff_base: activity.diff_base.clone(),
}).map_err(|e| Error::ReviewActivity(Box::new(e)))?;
crev_common::save_to_yaml_file(
&latest_path,
&LatestReviewActivity {
source: source.to_string(),
name: name.to_string(),
version: version.clone(),
diff_base: activity.diff_base.clone(),
},
)
.map_err(|e| Error::ReviewActivity(Box::new(e)))?;

Ok(())
}
Expand Down

0 comments on commit 5daad96

Please sign in to comment.