Skip to content

Commit

Permalink
chore: Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysonsantos committed Dec 27, 2023
1 parent 51ebd48 commit 117dac7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions lib/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fs;
use std::{fmt::Write, fs};

use async_trait::async_trait;
use rand::{thread_rng, Rng};
Expand Down Expand Up @@ -49,11 +49,11 @@ impl TimeSync {
TimeSync::Future {
last_time_checked: _,
time_offset,
} => (time + time_offset),
} => time + time_offset,
TimeSync::Past {
last_time_checked: _,
time_offset,
} => (time - time_offset),
} => time - time_offset,
}
}
}
Expand Down Expand Up @@ -108,10 +108,10 @@ impl AuthyClient {
pub fn with_url(url: &str, device_name: &str, backup_password: &str) -> Result<Self> {
let mut signature = [0u8; 32];
thread_rng().fill(&mut signature);
let signature = signature
.iter()
.map(|n| format!("{:x}", n))
.collect::<String>();
let signature = signature.iter().fold(String::new(), |mut output, n| {
let _ = write!(output, "{:x}", n);
output
});

Ok(Self {
url: url.parse()?,
Expand Down Expand Up @@ -236,7 +236,7 @@ impl AuthyClientApi for AuthyClient {
#[instrument]
async fn complete_registration(&mut self, pin: &str) -> Result<()> {
// I'm assuming this is used for idempotency so this should suffice
let uuid = format!("{:x}", md5::compute(&pin.as_bytes()));
let uuid = format!("{:x}", md5::compute(pin.as_bytes()));
let payload = AuthyCompleteRegistrationRequest {
api_key: API_KEY.to_string(),
locale: DEFAULT_LOCALE.to_string(),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum CheckRegistrationStatus {

impl Device {
pub(crate) fn hash_secret(&self) -> String {
format!("{:x}", sha2::Sha256::digest(&self.secret_seed.as_bytes()))
format!("{:x}", sha2::Sha256::digest(self.secret_seed.as_bytes()))
}
}

Expand Down
4 changes: 2 additions & 2 deletions stub_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ impl WiremockRunner {

check_process(
&compose()
.args(&["up", "-d"])
.args(["up", "-d"])
.output()
.await
.wrap_err("error to bring wiremock up")?,
)?;

let host = check_process(
&compose()
.args(&["port", "wiremock", "8080"])
.args(["port", "wiremock", "8080"])
.output()
.await
.wrap_err("failed to get wiremock port")?,
Expand Down

0 comments on commit 117dac7

Please sign in to comment.