Skip to content

Commit

Permalink
doc: Remove cargo expand
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed Oct 18, 2024
1 parent a9dafb4 commit 44e0037
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,51 +473,6 @@ impl JwtVerifier {
}
}
```
<details>

<summary>Cargo Expand</summary>

```rust
#[derive(Debug)]
pub enum FirebaseJwtVerifierCreationError {
Reqwest(reqwest::Error),
Jwt(jsonwebtoken::errors::Error),
}
#[allow(unused_qualifications)]
impl std::error::Error for FirebaseJwtVerifierCreationError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match *self {
FirebaseJwtVerifierCreationError::Reqwest(ref source) => source.source(),
FirebaseJwtVerifierCreationError::Jwt(ref source) => source.source(),
#[allow(unreachable_patterns)]
_ => None,
}
}
}
impl core::fmt::Display for FirebaseJwtVerifierCreationError {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
let variant_name = match *self {
FirebaseJwtVerifierCreationError::Reqwest(_) => {
"FirebaseJwtVerifierCreationError::Reqwest"
}
FirebaseJwtVerifierCreationError::Jwt(_) => "FirebaseJwtVerifierCreationError::Jwt",
};
f.write_fmt($crate::format_args!("{}", variant_name))
}
}
impl From<reqwest::Error> for FirebaseJwtVerifierCreationError {
fn from(error: reqwest::Error) -> Self {
FirebaseJwtVerifierCreationError::Reqwest(error)
}
}
impl From<jsonwebtoken::errors::Error> for FirebaseJwtVerifierCreationError {
fn from(error: jsonwebtoken::errors::Error) -> Self {
FirebaseJwtVerifierCreationError::Jwt(error)
}
}
```
</details>

Error sets also supports inline structs for passing error related data and custom display messages.
Just add the `#[display(...)]` attribute to the variant.
Expand Down

0 comments on commit 44e0037

Please sign in to comment.