Release 1.1.1
This commit is contained in:
parent
60b511a97a
commit
92bc6b8dd4
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "jsonwebtoken"
|
||||
version = "1.1.0"
|
||||
version = "1.1.1"
|
||||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
Add the following to Cargo.toml:
|
||||
|
||||
```toml
|
||||
jsonwebtoken = "1.0"
|
||||
jsonwebtoken = "1"
|
||||
rustc-serialize = "0.3"
|
||||
```
|
||||
|
||||
|
@ -72,5 +72,6 @@ test bench_encode ... bench: 4,261 ns/iter (+/- 722)
|
|||
|
||||
## Changelog
|
||||
|
||||
1.1.1: Don't serialize empty fields in header
|
||||
1.1.0: Impl Error for jsonwebtoken errors
|
||||
1.0: Initial release
|
||||
|
|
13
src/lib.rs
13
src/lib.rs
|
@ -31,10 +31,10 @@ pub enum Algorithm {
|
|||
|
||||
impl ToJson for Algorithm {
|
||||
fn to_json(&self) -> Json {
|
||||
match self {
|
||||
&Algorithm::HS256 => Json::String("HS256".to_owned()),
|
||||
&Algorithm::HS384 => Json::String("HS384".to_owned()),
|
||||
&Algorithm::HS512 => Json::String("HS512".to_owned()),
|
||||
match *self {
|
||||
Algorithm::HS256 => Json::String("HS256".to_owned()),
|
||||
Algorithm::HS384 => Json::String("HS384".to_owned()),
|
||||
Algorithm::HS512 => Json::String("HS512".to_owned()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,9 +109,8 @@ impl ToJson for Header {
|
|||
// Define a macro to reduce boilerplate.
|
||||
macro_rules! optional {
|
||||
($field_name:ident) => (
|
||||
match self.$field_name {
|
||||
Some(ref value) => { d.insert(stringify!($field_name).to_string(), value.to_json()); },
|
||||
None => {},
|
||||
if let Some(ref value) = self.$field_name {
|
||||
d.insert(stringify!($field_name).to_string(), value.to_json());
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue