Skip to content

Rename named modules to mod.rs #157

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

Merged
merged 4 commits into from
Jun 9, 2021
Merged
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
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,41 +91,41 @@ jobs:
target
key: ${{ runner.os }}-nightly-clippy-cargo-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-nightly-cargo-target-${{ hashFiles('**/Cargo.lock') }}
- name: Run clippy --all-targets --no-default-features -- -D warnings
- name: Run clippy --all-targets --no-default-features
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --no-default-features -- -D warnings
- name: Run clippy --all-targets --no-default-features --features "helix" -- -D warnings
args: --all-targets --no-default-features
- name: Run clippy --all-targets --no-default-features --features "helix"
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --no-default-features --features "helix" -- -D warnings
- name: Run clippy --all-targets --no-default-features --features "tmi" -- -D warnings
args: --all-targets --no-default-features --features "helix"
- name: Run clippy --all-targets --no-default-features --features "tmi"
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --no-default-features --features "tmi" -- -D warnings
- name: Run clippy --all-targets --no-default-features --features "pubsub" -- -D warnings
args: --all-targets --no-default-features --features "tmi"
- name: Run clippy --all-targets --no-default-features --features "pubsub"
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --no-default-features --features "pubsub" -- -D warnings
- name: Run clippy --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }} trace_unknown_fields" -- -D warnings
args: --all-targets --no-default-features --features "pubsub"
- name: Run clippy --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }} trace_unknown_fields"
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }} trace_unknown_fields" -- -D warnings
- name: Run clippy --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }}" -- -D warnings
args: --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }} trace_unknown_fields"
- name: Run clippy --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }}"
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }}" -- -D warnings
- name: Run clippy --all-targets --all-features -- -D warnings
args: --all-targets --features "${{ env.CI_TWITCH_API2_FEATURES }}"
- name: Run clippy --all-targets --all-features
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features -- -D warnings
args: --all-targets --all-features
docs:
name: Docs
runs-on: ubuntu-latest
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions src/helix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,14 @@ pub trait RequestPost: Request {
where
Self: Sized,
{
let text = std::str::from_utf8(&response.body()).map_err(|e| {
let text = std::str::from_utf8(response.body()).map_err(|e| {
HelixRequestPostError::Utf8Error(response.body().clone(), e, uri.clone())
})?;
if let Ok(HelixRequestError {
error,
status,
message,
}) = parse_json::<HelixRequestError>(&text, false)
}) = parse_json::<HelixRequestError>(text, false)
{
return Err(HelixRequestPostError::Error {
error,
Expand All @@ -408,7 +408,7 @@ pub trait RequestPost: Request {
where
Self: Sized,
{
let response: InnerResponse<<Self as Request>::Response> = parse_json(&response, true)
let response: InnerResponse<<Self as Request>::Response> = parse_json(response, true)
.map_err(|e| {
HelixRequestPostError::DeserializeError(
response.to_string(),
Expand Down Expand Up @@ -471,14 +471,14 @@ pub trait RequestPatch: Request {
where
Self: Sized,
{
let text = std::str::from_utf8(&response.body()).map_err(|e| {
let text = std::str::from_utf8(response.body()).map_err(|e| {
HelixRequestPatchError::Utf8Error(response.body().clone(), e, uri.clone())
})?;
if let Ok(HelixRequestError {
error,
status,
message,
}) = parse_json::<HelixRequestError>(&text, false)
}) = parse_json::<HelixRequestError>(text, false)
{
return Err(HelixRequestPatchError::Error {
error,
Expand Down Expand Up @@ -540,14 +540,14 @@ pub trait RequestDelete: Request {
where
Self: Sized,
{
let text = std::str::from_utf8(&response.body()).map_err(|e| {
let text = std::str::from_utf8(response.body()).map_err(|e| {
HelixRequestDeleteError::Utf8Error(response.body().clone(), e, uri.clone())
})?;
if let Ok(HelixRequestError {
error,
status,
message,
}) = parse_json::<HelixRequestError>(&text, false)
}) = parse_json::<HelixRequestError>(text, false)
{
return Err(HelixRequestDeleteError::Error {
error,
Expand Down Expand Up @@ -616,14 +616,14 @@ pub trait RequestPut: Request {
where
Self: Sized,
{
let text = std::str::from_utf8(&response.body()).map_err(|e| {
let text = std::str::from_utf8(response.body()).map_err(|e| {
HelixRequestPutError::Utf8Error(response.body().clone(), e, uri.clone())
})?;
if let Ok(HelixRequestError {
error,
status,
message,
}) = parse_json::<HelixRequestError>(&text, false)
}) = parse_json::<HelixRequestError>(text, false)
{
return Err(HelixRequestPutError::Error {
error,
Expand Down Expand Up @@ -685,15 +685,15 @@ pub trait RequestGet: Request {
where
Self: Sized,
{
let text = std::str::from_utf8(&response.body()).map_err(|e| {
let text = std::str::from_utf8(response.body()).map_err(|e| {
HelixRequestGetError::Utf8Error(response.body().clone(), e, uri.clone())
})?;
//eprintln!("\n\nmessage is ------------ {} ------------", text);
if let Ok(HelixRequestError {
error,
status,
message,
}) = parse_json::<HelixRequestError>(&text, false)
}) = parse_json::<HelixRequestError>(text, false)
{
return Err(HelixRequestGetError::Error {
error,
Expand Down
2 changes: 1 addition & 1 deletion src/helix/moderation/check_automod_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl helix::HelixRequestBody for Vec<CheckAutoModStatusBody> {
data: &'a Vec<CheckAutoModStatusBody>,
}

serde_json::to_vec(&InnerBody { data: &self }).map_err(Into::into)
serde_json::to_vec(&InnerBody { data: self }).map_err(Into::into)
}
}

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/helix/points/create_custom_rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl RequestPost for CreateCustomRewardRequest {
Self: Sized,
{
let response: helix::InnerResponse<Vec<Self::Response>> =
helix::parse_json(&response_str, true).map_err(|e| {
helix::parse_json(response_str, true).map_err(|e| {
helix::HelixRequestPostError::DeserializeError(
response_str.to_string(),
e,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/helix/polls/create_poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl RequestPost for CreatePollRequest {
Self: Sized,
{
let response: helix::InnerResponse<Vec<Self::Response>> =
helix::parse_json(&response_str, true).map_err(|e| {
helix::parse_json(response_str, true).map_err(|e| {
helix::HelixRequestPostError::DeserializeError(
response_str.to_string(),
e,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/helix/predictions/create_prediction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl RequestPost for CreatePredictionRequest {
Self: Sized,
{
let response: helix::InnerResponse<Vec<Self::Response>> =
helix::parse_json(&response_str, true).map_err(|e| {
helix::parse_json(response_str, true).map_err(|e| {
helix::HelixRequestPostError::DeserializeError(
response_str.to_string(),
e,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/helix/search/search_categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl RequestGet for SearchCategoriesRequest {
Self: Sized,
{
let response: helix::InnerResponse<Option<Self::Response>> =
helix::parse_json(&response, true).map_err(|e| {
helix::parse_json(response, true).map_err(|e| {
helix::HelixRequestGetError::DeserializeError(
response.to_string(),
e,
Expand Down
2 changes: 1 addition & 1 deletion src/helix/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ impl<'input, 'output> ser::Serializer for PairSerializer<'input, 'output> {
_variant_index: u32,
variant: &'static str,
) -> Result<Self::Ok, Self::Error> {
self.urlencoder.append_pair(self.key, &variant);
self.urlencoder.append_pair(self.key, variant);
Ok(self.urlencoder)
}

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/helix/subscriptions/check_user_subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl RequestGet for CheckUserSubscriptionRequest {
Self: Sized,
{
let inner_response: helix::InnerResponse<Vec<_>> =
helix::parse_json(&text, true).map_err(|e| {
helix::parse_json(text, true).map_err(|e| {
helix::HelixRequestGetError::DeserializeError(
text.to_string(),
e,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/helix/webhooks/hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ impl<T: Topic> RequestPost for WebhookHubRequest<T> {
where
Self: Sized,
{
let text = std::str::from_utf8(&response.body()).map_err(|e| {
let text = std::str::from_utf8(response.body()).map_err(|e| {
helix::HelixRequestPostError::Utf8Error(response.body().clone(), e, uri.clone())
})?;
if let Ok(helix::HelixRequestError {
error,
status,
message,
}) = helix::parse_json::<helix::HelixRequestError>(&text, false)
}) = helix::parse_json::<helix::HelixRequestError>(text, false)
{
return Err(helix::HelixRequestPostError::Error {
error,
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#![cfg_attr(nightly, deny(rustdoc::broken_intra_doc_links))]
#![cfg_attr(nightly, feature(doc_cfg))]
#![doc(html_root_url = "https://docs.rs/twitch_api2/0.5.0")]
#![cfg_attr(all(nightly, doctest), feature(external_doc))]
//! [![github]](https://github.com/emilgardis/twitch_api2)&ensp;[![crates-io]](https://crates.io/crates/twitch_api2)&ensp;[![docs-rs-big]](https://docs.rs/twitch_api2/0.5.0/twitch_api2)
//!
//! [github]: https://img.shields.io/badge/github-emilgardis/twitch__api2-8da0cb?style=for-the-badge&labelColor=555555&logo=github"
Expand Down Expand Up @@ -90,8 +89,12 @@
//! | <span class="module-item stab portability" style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"><code>deny_unknown_fields</code></span> | Adds `#[serde(deny_unknown_fields)]` on all applicable structs/enums. Please consider using this and filing an issue or PR when a new field has been added to the endpoint but not added to this library. |
//!

#[doc(include = "../README.md")]
#[cfg(all(doctest, feature = "all"))]
// FIXME: This is a hack to prevent early pass failing on
// `arbitrary expressions in key-value attributes are unstable` on stable rust pre 1.54.
// Remove when MSRV 1.54 (or when hits stable)
// https://github.com/rust-lang/rust/issues/82768
/// Doc test for README
#[cfg_attr(all(doctest, nightly, feature = "all"), cfg_attr(all(doctest, nightly, feature = "all"), doc = include_str!("../README.md")))]
pub struct ReadmeDoctests;

pub mod types;
Expand Down