Skip to content

Commit 8b02aaf

Browse files
chore(webauthn): allow clippy::expect_used on infallible clientDataJSON
to_json serializes a fixed-shape struct of strings and a bool, which serde_json cannot fail to encode. The API is intentionally infallible, so allow expect_used on the function rather than threading a Result through hash() and every caller.
1 parent c7a17d5 commit 8b02aaf

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

libwebauthn/src/ops/webauthn/client_data.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ impl ClientData {
4141
/// Strings are escaped per WebAuthn L3 §5.8.1.2 (CCDToString), via
4242
/// `serde_json`'s RFC 8259 string encoder. Field order matches the spec:
4343
/// `type`, `challenge`, `origin`, `topOrigin?`, `crossOrigin`.
44+
#[allow(clippy::expect_used)] // serialization of this fixed-shape struct cannot fail
4445
pub fn to_json(&self) -> String {
4546
let operation = match self.operation {
4647
Operation::MakeCredential => "webauthn.create",

0 commit comments

Comments
 (0)