-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove unsafe code in gateway #1042
Remove unsafe code in gateway #1042
Conversation
Remove unsafe code in the `gateway` crate's use of `unsafe` to accommodate `simd-json`, by instead continuously working with the mutable buffer directly instead of going from bytes -> str -> bytes again. This also adds `#![deny(unsafe_code)]` to all crates that weren't already marked with it. Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
Shouldn't this be |
It doesn't really matter either way. The difference is that with |
Remove unsafe code in the `gateway` crate's use of `unsafe` to accommodate `simd-json`, by instead continuously working with the mutable buffer directly instead of going from bytes -> str -> bytes again. This also adds `#![deny(unsafe_code)]` to all crates that weren't already marked with it.
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). [#1042]: #1042 [@zeylahellyer]: https://github.com/zeylahellyer
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). [#1042]: #1042 [@zeylahellyer]: https://github.com/zeylahellyer
Additions Add `EventTypeFlags` constants with categories of flags that are equivalent to their Intents counterpart. For example, the new `EventTypeFlags::GUILD_BANS` associated constant includes the `BAN_ADD` and `BAN_REMOVE` event type flags. The following categories have been added ([#1049] - [@vilgotf]): - `DIRECT_MESSAGES` - `DIRECT_MESSAGE_REACTIONS` - `DIRECT_MESSAGE_TYPING` - `GUILDS` - `GUILD_BANS` - `GUILD_EMOJIS` - `GUILD_INTEGRATIONS` - `GUILD_INVITES` - `GUILD_MEMBERS` - `GUILD_MESSAGES` - `GUILD_MESSAGE_REACTIONS` - `GUILD_MESSAGE_TYPING` - `GUILD_PRESENCES` - `GUILD_VOICE_STATES` - `GUILD_WEBHOOKS` Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate. To comply with this, while using the `simd-json` feature, the mutable buffer is directly used instead of casting from bytes -> str -> bytes ([#1042] - [@zeylahellyer]). [#1042]: #1042 [#1049]: #1049 [@vilgotf]: https://github.com/vilgotf [@zeylahellyer]: https://github.com/zeylahellyer
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). [#1042]: #1042 [@zeylahellyer]: https://github.com/zeylahellyer
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). Fixes The `JSON` body is now actually serialized on the `update_channel` route ([#1051] - [@Learath2]). [#1042]: #1042 [#1051]: #1051 [@Learath2]: https://github.com/Learath2 [@zeylahellyer]: https://github.com/zeylahellyer
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). [#1042]: #1042 [@zeylahellyer]: https://github.com/zeylahellyer
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). [#1042]: #1042 [@zeylahellyer]: https://github.com/zeylahellyer
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). [#1042]: #1042 [@zeylahellyer]: https://github.com/zeylahellyer
Changes `#![deny(unsafe_code)]` has been added, ensuring no unsafe code exists in the crate ([#1042] - [@zeylahellyer]). [#1042]: twilight-rs/twilight#1042 [@zeylahellyer]: https://github.com/zeylahellyer
Remove unsafe code in the
gateway
crate. Its use ofunsafe
was to accommodatesimd-json
, but can be removed by instead continuously working with the mutable buffer rather than going from bytes -> str -> bytes again.This also adds
#![deny(unsafe_code)]
to all crates that weren't already marked with it.