Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deserialisation of Token type #3086

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

arqunis
Copy link
Member

@arqunis arqunis commented Jan 3, 2025

The Deserialize implementation neglects to add the Bot prefix to the string when it is deserialised.

This adds TryFrom implementations for &str and String and tells serde to deserialise Token using the TryFrom<&str> implementation, which will prepend the Bot prefix.

Fixes #3085

@arqunis arqunis added enhancement An improvement to Serenity. fix A solution to an existing bug. labels Jan 3, 2025
The `Deserialize` implementation neglects to add the `Bot ` prefix to
the string when it is deserialised. This adds `TryFrom` implementations
for `&str` and `String` and tells serde to deserialise `Token` using the
`TryFrom<&str>` implementation, which will prepend the `Bot ` prefix.
@arqunis arqunis merged commit 5943323 into serenity-rs:next Jan 9, 2025
23 of 24 checks passed
@arqunis arqunis deleted the fix_token_deser branch January 9, 2025 17:24
arqunis added a commit to arqunis/serenity that referenced this pull request Jan 16, 2025
The `Deserialize` implementation neglects to add the `Bot ` prefix to
the string when it is deserialised.

This adds `TryFrom` implementations for `&str` and `String` and tells
serde to deserialise `Token` using the `TryFrom<&str>` implementation,
which will prepend the `Bot ` prefix.

Fixes serenity-rs#3085
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to Serenity. fix A solution to an existing bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants