Skip to content

Commit

Permalink
fixup! Merge pull request google#184 from google/dependabot/cargo/rus…
Browse files Browse the repository at this point in the history
…t/cargo-5c0860a51f

appease linter
  • Loading branch information
burgerdev committed Dec 14, 2024
1 parent 4b9bbb5 commit aa1fc03
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rust/src/cli/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ fn pubkey(stdin: &mut dyn io::Read, stdout: &mut dyn io::Write) -> CommandResult
let sk: StaticSecret = buf.into();
let pk: PublicKey = (&sk).into();

Ok(write!(
Ok(writeln!(
stdout,
"glome-v1 {}\n",
"glome-v1 {}",
general_purpose::URL_SAFE.encode(pk.as_bytes())
)?)
}
Expand Down Expand Up @@ -101,7 +101,7 @@ fn gentag(args: &TagArgs, stdin: &mut dyn io::Read, stdout: &mut dyn io::Write)

let t = glome::tag(&ours, &theirs, ctr, &msg);

let encoded = general_purpose::URL_SAFE.encode(&t);
let encoded = general_purpose::URL_SAFE.encode(t);

Ok(stdout.write_all(encoded.as_bytes())?)
}
Expand All @@ -115,7 +115,7 @@ fn login(args: &LoginArgs, stdout: &mut dyn io::Write) -> CommandResult {
};
let (_, challenge) = args.challenge.split_at(challenge_start + 3);
let parts: Vec<_> = challenge.split("/").collect();
if parts.len() != 4 || parts[3] != "" {
if parts.len() != 4 || !parts[3].is_empty() {
return Err("unexpected format".into());
}
let mut handshake = general_purpose::URL_SAFE.decode(parts[0])?;
Expand Down Expand Up @@ -150,7 +150,7 @@ fn login(args: &LoginArgs, stdout: &mut dyn io::Write) -> CommandResult {

let t = glome::tag(&ours, &theirs, 0, msg.as_bytes());

let encoded = general_purpose::URL_SAFE.encode(&t);
let encoded = general_purpose::URL_SAFE.encode(t);

Ok(stdout.write_all(encoded.as_bytes())?)
}
Expand Down Expand Up @@ -253,7 +253,7 @@ mod tests {
#[test]
fn test_pubkey() {
for tc in test_vectors() {
for person in vec![tc.alice, tc.bob] {
for person in [tc.alice, tc.bob] {
let mut stdin = io::Cursor::new(person.private);
let mut stdout = io::Cursor::new(Vec::new());
pubkey(&mut stdin, &mut stdout).expect("pubkey should work");
Expand All @@ -275,7 +275,7 @@ mod tests {
#[test]
fn test_tag() {
for tc in test_vectors() {
let host = if tc.host_id_type == "" {
let host = if tc.host_id_type.is_empty() {
tc.host_id
} else {
format!("{}:{}", tc.host_id_type, tc.host_id)
Expand Down

0 comments on commit aa1fc03

Please sign in to comment.