Skip to content

jsonwebtoken T: Clone bound error #41

@dancixx

Description

@dancixx

Hi,

I am encountering the following error. The jsonwebtoken library has a bound requirement T: Clone + DeserializeOwned. I forked the repository and attempted to fix the issue, but I am unsure whether this error originates from this library. Could you please validate this assumption, as I will then open an issue in the other library?

error[E0277]: the trait bound `T: Clone` is not satisfied
   --> /Users/danixx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jsonwebtoken-9.3.1/src/decoding.rs:281:13
    |
281 |             Ok(TokenData { header, claims })
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `T`
    |
note: required by a bound in `TokenData`
   --> /Users/danixx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jsonwebtoken-9.3.1/src/decoding.rs:18:8
    |
16  | pub struct TokenData<T>
    |            --------- required by a bound in this struct
17  | where
18  |     T: Clone,
    |        ^^^^^ required by this bound in `TokenData`
help: consider further restricting type parameter `T` with trait `Clone`
    |
269 | pub fn decode<T: DeserializeOwned + std::clone::Clone>(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions