From 74eaebe44660f0b9c3a695ad1ee9c27c45267876 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Tue, 31 Jan 2023 19:31:13 +0100 Subject: [PATCH] Fix Clippy (#96) --- .github/workflows/main.yml | 2 +- src/common.rs | 7 ++++++- src/tests/parser.rs | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c09240e..8372dd3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -124,7 +124,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all-targets -- -D warnings + args: --all-features --all-targets -- -D warnings - name: Run cargo doc uses: actions-rs/cargo@v1 diff --git a/src/common.rs b/src/common.rs index ae1ab16..02721b8 100644 --- a/src/common.rs +++ b/src/common.rs @@ -388,7 +388,12 @@ where Err(Error::Protocol) } -/// Can only fail with [`Error::DeriveKeyPair`] and [`Error::Protocol`]. +/// Corresponds to DeriveKeyPair() function from the VOPRF specification. +/// +/// # Errors +/// - [`Error::DeriveKeyPair`] if the `input` and `seed` together are longer +/// then `u16::MAX - 3`. +/// - [`Error::Protocol`] if the protocol fails and can't be completed. #[cfg(feature = "danger")] pub fn derive_key( seed: &[u8], diff --git a/src/tests/parser.rs b/src/tests/parser.rs index 313859c..8cebec8 100644 --- a/src/tests/parser.rs +++ b/src/tests/parser.rs @@ -96,7 +96,7 @@ fn parse_params(input: &str) -> String { let key = iter.next().unwrap().split_whitespace().next().unwrap(); let val = iter.next().unwrap().split_whitespace().next().unwrap(); - param = format!(" \"{}\": \"{}", key, val); + param = format!(" \"{key}\": \"{val}"); } else { let s = line.trim().to_string(); if s.contains('~') || s.contains('#') {