From 8bfcebbd0e8a5a33da8a766e73f0673a26cdfb96 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Sat, 25 Nov 2017 10:38:43 +0100 Subject: [PATCH] Fix jwt::decode documentation in readme Apparently jwt::decode expects the secret to be a slice. Thus blindly copying the example code from the readme gives a compilation error. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b74b0a0..fa2094f 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Look at `examples/custom_header.rs` for a full working example. ### Decoding ```rust -let token = decode::(&token, "secret", &Validation::default())?; +let token = decode::(&token, "secret".as_ref(), &Validation::default())?; // token is a struct with 2 params: header and claims ``` `decode` can error for a variety of reasons: