Skip to content

Commit c96374c

Browse files
committed
apply clippy suggestions
1 parent 070fbfc commit c96374c

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

src/helix/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,14 @@ pub trait RequestPost: Request {
378378
where
379379
Self: Sized,
380380
{
381-
let text = std::str::from_utf8(&response.body()).map_err(|e| {
381+
let text = std::str::from_utf8(response.body()).map_err(|e| {
382382
HelixRequestPostError::Utf8Error(response.body().clone(), e, uri.clone())
383383
})?;
384384
if let Ok(HelixRequestError {
385385
error,
386386
status,
387387
message,
388-
}) = parse_json::<HelixRequestError>(&text, false)
388+
}) = parse_json::<HelixRequestError>(text, false)
389389
{
390390
return Err(HelixRequestPostError::Error {
391391
error,
@@ -408,7 +408,7 @@ pub trait RequestPost: Request {
408408
where
409409
Self: Sized,
410410
{
411-
let response: InnerResponse<<Self as Request>::Response> = parse_json(&response, true)
411+
let response: InnerResponse<<Self as Request>::Response> = parse_json(response, true)
412412
.map_err(|e| {
413413
HelixRequestPostError::DeserializeError(
414414
response.to_string(),
@@ -471,14 +471,14 @@ pub trait RequestPatch: Request {
471471
where
472472
Self: Sized,
473473
{
474-
let text = std::str::from_utf8(&response.body()).map_err(|e| {
474+
let text = std::str::from_utf8(response.body()).map_err(|e| {
475475
HelixRequestPatchError::Utf8Error(response.body().clone(), e, uri.clone())
476476
})?;
477477
if let Ok(HelixRequestError {
478478
error,
479479
status,
480480
message,
481-
}) = parse_json::<HelixRequestError>(&text, false)
481+
}) = parse_json::<HelixRequestError>(text, false)
482482
{
483483
return Err(HelixRequestPatchError::Error {
484484
error,
@@ -540,14 +540,14 @@ pub trait RequestDelete: Request {
540540
where
541541
Self: Sized,
542542
{
543-
let text = std::str::from_utf8(&response.body()).map_err(|e| {
543+
let text = std::str::from_utf8(response.body()).map_err(|e| {
544544
HelixRequestDeleteError::Utf8Error(response.body().clone(), e, uri.clone())
545545
})?;
546546
if let Ok(HelixRequestError {
547547
error,
548548
status,
549549
message,
550-
}) = parse_json::<HelixRequestError>(&text, false)
550+
}) = parse_json::<HelixRequestError>(text, false)
551551
{
552552
return Err(HelixRequestDeleteError::Error {
553553
error,
@@ -616,14 +616,14 @@ pub trait RequestPut: Request {
616616
where
617617
Self: Sized,
618618
{
619-
let text = std::str::from_utf8(&response.body()).map_err(|e| {
619+
let text = std::str::from_utf8(response.body()).map_err(|e| {
620620
HelixRequestPutError::Utf8Error(response.body().clone(), e, uri.clone())
621621
})?;
622622
if let Ok(HelixRequestError {
623623
error,
624624
status,
625625
message,
626-
}) = parse_json::<HelixRequestError>(&text, false)
626+
}) = parse_json::<HelixRequestError>(text, false)
627627
{
628628
return Err(HelixRequestPutError::Error {
629629
error,
@@ -685,15 +685,15 @@ pub trait RequestGet: Request {
685685
where
686686
Self: Sized,
687687
{
688-
let text = std::str::from_utf8(&response.body()).map_err(|e| {
688+
let text = std::str::from_utf8(response.body()).map_err(|e| {
689689
HelixRequestGetError::Utf8Error(response.body().clone(), e, uri.clone())
690690
})?;
691691
//eprintln!("\n\nmessage is ------------ {} ------------", text);
692692
if let Ok(HelixRequestError {
693693
error,
694694
status,
695695
message,
696-
}) = parse_json::<HelixRequestError>(&text, false)
696+
}) = parse_json::<HelixRequestError>(text, false)
697697
{
698698
return Err(HelixRequestGetError::Error {
699699
error,

src/helix/moderation/check_automod_status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl helix::HelixRequestBody for Vec<CheckAutoModStatusBody> {
105105
data: &'a Vec<CheckAutoModStatusBody>,
106106
}
107107

108-
serde_json::to_vec(&InnerBody { data: &self }).map_err(Into::into)
108+
serde_json::to_vec(&InnerBody { data: self }).map_err(Into::into)
109109
}
110110
}
111111

src/helix/points/create_custom_rewards.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl RequestPost for CreateCustomRewardRequest {
143143
Self: Sized,
144144
{
145145
let response: helix::InnerResponse<Vec<Self::Response>> =
146-
helix::parse_json(&response_str, true).map_err(|e| {
146+
helix::parse_json(response_str, true).map_err(|e| {
147147
helix::HelixRequestPostError::DeserializeError(
148148
response_str.to_string(),
149149
e,

src/helix/polls/create_poll.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl RequestPost for CreatePollRequest {
150150
Self: Sized,
151151
{
152152
let response: helix::InnerResponse<Vec<Self::Response>> =
153-
helix::parse_json(&response_str, true).map_err(|e| {
153+
helix::parse_json(response_str, true).map_err(|e| {
154154
helix::HelixRequestPostError::DeserializeError(
155155
response_str.to_string(),
156156
e,

src/helix/predictions/create_prediction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl RequestPost for CreatePredictionRequest {
142142
Self: Sized,
143143
{
144144
let response: helix::InnerResponse<Vec<Self::Response>> =
145-
helix::parse_json(&response_str, true).map_err(|e| {
145+
helix::parse_json(response_str, true).map_err(|e| {
146146
helix::HelixRequestPostError::DeserializeError(
147147
response_str.to_string(),
148148
e,

src/helix/search/search_categories.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl RequestGet for SearchCategoriesRequest {
8484
Self: Sized,
8585
{
8686
let response: helix::InnerResponse<Option<Self::Response>> =
87-
helix::parse_json(&response, true).map_err(|e| {
87+
helix::parse_json(response, true).map_err(|e| {
8888
helix::HelixRequestGetError::DeserializeError(
8989
response.to_string(),
9090
e,

src/helix/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ impl<'input, 'output> ser::Serializer for PairSerializer<'input, 'output> {
674674
_variant_index: u32,
675675
variant: &'static str,
676676
) -> Result<Self::Ok, Self::Error> {
677-
self.urlencoder.append_pair(self.key, &variant);
677+
self.urlencoder.append_pair(self.key, variant);
678678
Ok(self.urlencoder)
679679
}
680680

src/helix/subscriptions/check_user_subscription.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl RequestGet for CheckUserSubscriptionRequest {
9595
Self: Sized,
9696
{
9797
let inner_response: helix::InnerResponse<Vec<_>> =
98-
helix::parse_json(&text, true).map_err(|e| {
98+
helix::parse_json(text, true).map_err(|e| {
9999
helix::HelixRequestGetError::DeserializeError(
100100
text.to_string(),
101101
e,

src/helix/webhooks/hub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ impl<T: Topic> RequestPost for WebhookHubRequest<T> {
183183
where
184184
Self: Sized,
185185
{
186-
let text = std::str::from_utf8(&response.body()).map_err(|e| {
186+
let text = std::str::from_utf8(response.body()).map_err(|e| {
187187
helix::HelixRequestPostError::Utf8Error(response.body().clone(), e, uri.clone())
188188
})?;
189189
if let Ok(helix::HelixRequestError {
190190
error,
191191
status,
192192
message,
193-
}) = helix::parse_json::<helix::HelixRequestError>(&text, false)
193+
}) = helix::parse_json::<helix::HelixRequestError>(text, false)
194194
{
195195
return Err(helix::HelixRequestPostError::Error {
196196
error,

0 commit comments

Comments
 (0)