-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix negative nonces failing to deserialize
Negative message nonces caused deserialization errors, as serde would not deserialize integers into strings. To fix this, change `Message::nonce` into an `Option<Snowflake>` from an `Option<String>`. This new `Snowflake` is a wrapper around an `i64`. Use a new `I64Visitor` to deserialize i64s, u64s, and strs into the wanted i64.
- Loading branch information
Zeyla Hellyer
committed
Jun 11, 2017
1 parent
2f30f9a
commit d0b64cd
Showing
5 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"type": 0, | ||
"tts": false, | ||
"timestamp": "2017-01-01T01:01:01.100000+00:00", | ||
"pinned": false, | ||
"nonce": -6000000000000000, | ||
"mentions": [], | ||
"mention_roles": [], | ||
"mention_everyone": false, | ||
"id": "300000000000000000", | ||
"embeds": [], | ||
"edited_timestamp": null, | ||
"content": "fake", | ||
"channel_id": "100000000000000000", | ||
"author": { | ||
"username": "fake", | ||
"id": "300000000000000000", | ||
"discriminator": "1234", | ||
"bot": true, | ||
"avatar": "f133549aac3208319a9fbc3c12345678" | ||
}, | ||
"attachments": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters