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

chore(gateway, http): small code nits #1103

Merged
merged 6 commits into from
Aug 17, 2021
Merged

chore(gateway, http): small code nits #1103

merged 6 commits into from
Aug 17, 2021

Conversation

vilgotf
Copy link
Member

@vilgotf vilgotf commented Aug 12, 2021

Discord recommends explicitly stating the encoding.

Copy link
Member

@zeylahellyer zeylahellyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Just documentation nits. I would appreciate it if the explicit encoding string addition would be a different PR though

gateway/src/shard/processor/impl.rs Show resolved Hide resolved
gateway/src/shard/impl.rs Outdated Show resolved Hide resolved
http/src/response/mod.rs Show resolved Hide resolved
Copy link
Contributor

@7596ff 7596ff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the vec![] note and it seems good to go

gateway/src/shard/processor/impl.rs Outdated Show resolved Hide resolved
@7596ff 7596ff added c-gateway Affects the gateway crate c-http Affects the http crate t-chore labels Aug 14, 2021
7596ff
7596ff previously approved these changes Aug 14, 2021
@vilgotf vilgotf requested a review from zeylahellyer August 14, 2021 16:50
@zeylahellyer zeylahellyer requested a review from 7596ff August 17, 2021 16:29
@zeylahellyer zeylahellyer merged commit c123655 into twilight-rs:main Aug 17, 2021
@zeylahellyer
Copy link
Member

Thanks

zeylahellyer added a commit that referenced this pull request Aug 18, 2021
Additions

Add 6 new HTTP API error codes:

- 10049: Unknown stream
- 10050: Unknown premium server subscribe cooldown
- 10070: Unknown Guild Scheduled Event
- 10071: Unknown Guild Scheduled Event User
- 50095: This server is not available in your location
- 50097: This server needs monetization enabled in order to perform this
action

([#1094] - [@Erk-]).

Fixes

Fix `ResponseFuture` returning mismatched `RequestTimedOut` and
`RequestError` error type variants ([#1100] - [@vilgotf]).

Enhancements

Improve the performance of `Response::bytes` ([#1103] - [@vilgotf]).

Add `[#must_use]` to typed HTTP request builders
([#1099] - [@zeylahellyer]).

[@Erk-]: https://github.com/Erk-
[@vilgotf]: https://github.com/vilgotf
[@zeylahellyer]: https://github.com/zeylahellyer
[#1103]: #1103
[#1100]: #1100
[#1099]: #1099
[#1094]: #1094

Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
@vilgotf vilgotf deleted the refactor/random-nits branch August 18, 2021 04:58
7596ff added a commit to 7596ff/twilight that referenced this pull request Aug 25, 2021
Perform a few nits on the codebase:

- **gateway**: in `Shard::start` use `str::to_string` over a cloned
`Box<str>::into_string`
- **gateway**: in `Shard::start` internally document authenticated bot
information retrieval
- **gateway**: in `ShardProcessor::new` explicitly pass the encoding
- **gateway**: in `ShardProcessor::run` use `if let` instead of `match`
- **http**: in `Response::bytes` use `vec!` for performance

Co-authored-by: Cassandra McCarthy <cassie@7596ff.com>
Co-authored-by: Zeyla Hellyer <zeyla@hellyer.dev>
7596ff pushed a commit to 7596ff/twilight that referenced this pull request Aug 25, 2021
Additions

Add 6 new HTTP API error codes:

- 10049: Unknown stream
- 10050: Unknown premium server subscribe cooldown
- 10070: Unknown Guild Scheduled Event
- 10071: Unknown Guild Scheduled Event User
- 50095: This server is not available in your location
- 50097: This server needs monetization enabled in order to perform this
action

([twilight-rs#1094] - [@Erk-]).

Fixes

Fix `ResponseFuture` returning mismatched `RequestTimedOut` and
`RequestError` error type variants ([twilight-rs#1100] - [@vilgotf]).

Enhancements

Improve the performance of `Response::bytes` ([twilight-rs#1103] - [@vilgotf]).

Add `[#must_use]` to typed HTTP request builders
([twilight-rs#1099] - [@zeylahellyer]).

[@Erk-]: https://github.com/Erk-
[@vilgotf]: https://github.com/vilgotf
[@zeylahellyer]: https://github.com/zeylahellyer
[twilight-rs#1103]: twilight-rs#1103
[twilight-rs#1100]: twilight-rs#1100
[twilight-rs#1099]: twilight-rs#1099
[twilight-rs#1094]: twilight-rs#1094

Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-gateway Affects the gateway crate c-http Affects the http crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants