|
8 | 8 | //! Claims can be any `serde::Serialize` type, usually derived with
|
9 | 9 | //! `serde_derive`.
|
10 | 10 | //! ```rust
|
11 |
| -//! extern crate hmac; |
12 |
| -//! extern crate sha2; |
13 |
| -//! |
14 | 11 | //! use hmac::{Hmac, NewMac};
|
15 | 12 | //! use jwt::SignWithKey;
|
16 | 13 | //! use sha2::Sha256;
|
|
31 | 28 | //! Claims can be any `serde::Deserialize` type, usually derived with
|
32 | 29 | //! `serde_derive`.
|
33 | 30 | //! ```rust
|
34 |
| -//! extern crate hmac; |
35 |
| -//! extern crate sha2; |
36 |
| -//! |
37 | 31 | //! use hmac::{Hmac, NewMac};
|
38 | 32 | //! use jwt::VerifyWithKey;
|
39 | 33 | //! use sha2::Sha256;
|
|
56 | 50 | //! #### Signing
|
57 | 51 | //! Both header and claims have to implement `serde::Serialize`.
|
58 | 52 | //! ```rust
|
59 |
| -//! extern crate hmac; |
60 |
| -//! extern crate sha2; |
61 |
| -//! |
62 | 53 | //! use hmac::{Hmac, NewMac};
|
63 | 54 | //! use jwt::{AlgorithmType, Header, SignWithKey, Token};
|
64 | 55 | //! use sha2::Sha384;
|
|
82 | 73 | //! #### Verification
|
83 | 74 | //! Both header and claims have to implement `serde::Deserialize`.
|
84 | 75 | //! ```rust
|
85 |
| -//! extern crate hmac; |
86 |
| -//! extern crate sha2; |
87 |
| -//! |
88 | 76 | //! use hmac::{Hmac, NewMac};
|
89 | 77 | //! use jwt::{AlgorithmType, Header, Token, VerifyWithKey};
|
90 | 78 | //! use sha2::Sha384;
|
|
104 | 92 | //! # try_main().unwrap()
|
105 | 93 | //! ```
|
106 | 94 |
|
107 |
| -extern crate base64; |
108 |
| -extern crate crypto_mac; |
109 |
| -extern crate digest; |
110 |
| -#[cfg(doctest)] |
111 |
| -#[macro_use] |
112 |
| -extern crate doc_comment; |
113 |
| -extern crate hmac; |
114 |
| -#[cfg(feature = "openssl")] |
115 |
| -extern crate openssl; |
116 |
| -extern crate serde; |
117 |
| -#[macro_use] |
118 |
| -extern crate serde_derive; |
119 |
| -extern crate serde_json; |
120 |
| -extern crate sha2; |
121 |
| - |
122 | 95 | #[cfg(doctest)]
|
123 | 96 | doctest!("../README.md");
|
124 | 97 |
|
125 |
| -use serde::{Deserialize, Serialize}; |
126 | 98 | use std::borrow::Cow;
|
127 | 99 |
|
| 100 | +#[cfg(doctest)] |
| 101 | +use doc_comment::doctest; |
| 102 | +use serde::{Deserialize, Serialize}; |
| 103 | + |
128 | 104 | #[cfg(feature = "openssl")]
|
129 | 105 | pub use crate::algorithm::openssl::PKeyWithDigest;
|
130 | 106 | pub use crate::algorithm::store::Store;
|
|
0 commit comments