Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions crates/common/src/protocol/jwt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,7 @@ impl FromStr for KeyId {
}
}

impl TryFrom<String> for KeyId {
type Error = InvalidKeyId;
/// Validates owned text, as serde reads it.
fn try_from(value: String) -> Result<Self, Self::Error> {
value.parse()
}
}

impl From<KeyId> for String {
/// The identifier unchanged.
fn from(value: KeyId) -> Self {
value.0
}
}
text_conversions!(KeyId);

impl fmt::Display for KeyId {
/// Writes the identifier unchanged.
Expand Down
15 changes: 1 addition & 14 deletions crates/common/src/protocol/oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,20 +419,7 @@ impl FromStr for ErrorDescription {
}
}

impl TryFrom<String> for ErrorDescription {
type Error = InvalidDescription;
/// Same as `parse`.
fn try_from(text: String) -> Result<Self, Self::Error> {
text.parse()
}
}

impl From<ErrorDescription> for String {
/// The description text.
fn from(description: ErrorDescription) -> Self {
description.0
}
}
text_conversions!(ErrorDescription);

impl fmt::Display for ErrorDescription {
/// Writes the description.
Expand Down