Skip to content

Commit 4df1e47

Browse files
authored
Suppress warnings when cargo test --no-default-features (#289)
1 parent 9343c66 commit 4df1e47

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

tests/ecdsa/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
use jsonwebtoken::{
22
crypto::{sign, verify},
3-
decode, encode, Algorithm, DecodingKey, EncodingKey, Header, Validation,
3+
Algorithm, DecodingKey, EncodingKey,
44
};
55
use serde::{Deserialize, Serialize};
6+
7+
#[cfg(feature = "use_pem")]
8+
use jsonwebtoken::{decode, encode, Header, Validation};
9+
#[cfg(feature = "use_pem")]
610
use time::OffsetDateTime;
711

812
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]

tests/eddsa/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
use jsonwebtoken::{
22
crypto::{sign, verify},
3-
decode, encode, Algorithm, DecodingKey, EncodingKey, Header, Validation,
3+
Algorithm, DecodingKey, EncodingKey,
44
};
55
use serde::{Deserialize, Serialize};
6+
7+
#[cfg(feature = "use_pem")]
8+
use jsonwebtoken::{decode, encode, Header, Validation};
9+
#[cfg(feature = "use_pem")]
610
use time::OffsetDateTime;
711

812
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]

tests/rsa/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
use jsonwebtoken::{
22
crypto::{sign, verify},
3-
decode, encode, Algorithm, DecodingKey, EncodingKey, Header, Validation,
3+
Algorithm, DecodingKey, EncodingKey,
44
};
55
use serde::{Deserialize, Serialize};
6+
7+
#[cfg(feature = "use_pem")]
8+
use jsonwebtoken::{decode, encode, Header, Validation};
9+
#[cfg(feature = "use_pem")]
610
use time::OffsetDateTime;
711

812
const RSA_ALGORITHMS: &[Algorithm] = &[

0 commit comments

Comments
 (0)