Skip to content

Commit 0e13288

Browse files
committed
formatting
1 parent adce63e commit 0e13288

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

benches/jwt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use std::collections::HashMap;
21
use criterion::{black_box, criterion_group, criterion_main, Criterion};
32
use jsonwebtoken::{decode, encode, Algorithm, DecodingKey, EncodingKey, Header, Validation};
43
use serde::{Deserialize, Serialize};
4+
use std::collections::HashMap;
55

66
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
77
struct Claims {
@@ -14,7 +14,7 @@ fn bench_encode(c: &mut Criterion) {
1414
let key = EncodingKey::from_secret("secret".as_ref());
1515
let mut extras = HashMap::with_capacity(1);
1616
extras.insert("custom".to_string(), "header".to_string());
17-
let header = &Header{extras: Some(extras), ..Default::default()};
17+
let header = &Header { extras: Some(extras), ..Default::default() };
1818

1919
c.bench_function("bench_encode", |b| {
2020
b.iter(|| encode(black_box(header), black_box(&claim), black_box(&key)))

src/validation.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,13 @@ where
344344
formatter.write_str("A NumericType that can be reasonably coerced into a u64")
345345
}
346346

347+
fn visit_u64<E>(self, value: u64) -> std::result::Result<Self::Value, E>
348+
where
349+
E: de::Error,
350+
{
351+
Ok(TryParse::Parsed(value))
352+
}
353+
347354
fn visit_f64<E>(self, value: f64) -> std::result::Result<Self::Value, E>
348355
where
349356
E: de::Error,
@@ -354,13 +361,6 @@ where
354361
Err(serde::de::Error::custom("NumericType must be representable as a u64"))
355362
}
356363
}
357-
358-
fn visit_u64<E>(self, value: u64) -> std::result::Result<Self::Value, E>
359-
where
360-
E: de::Error,
361-
{
362-
Ok(TryParse::Parsed(value))
363-
}
364364
}
365365

366366
match deserializer.deserialize_any(NumericType(PhantomData)) {

0 commit comments

Comments
 (0)