Skip to content

Commit dac4493

Browse files
authored
Remove #[allow(unused_mut)] (#231)
Remove #[allow(unused_mut)]
2 parents f7ba837 + 3af12d9 commit dac4493

File tree

5 files changed

+0
-13
lines changed

5 files changed

+0
-13
lines changed

examples/src/body_types.rs

-4
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,24 @@ struct Message {
1111
contents: String,
1212
}
1313

14-
#[allow(unused_mut)] // Workaround clippy bug
1514
async fn echo_string(mut cx: Context<()>) -> String {
1615
let msg = cx.body_string().await.unwrap();
1716
println!("String: {}", msg);
1817
msg
1918
}
2019

21-
#[allow(unused_mut)] // Workaround clippy bug
2220
async fn echo_bytes(mut cx: Context<()>) -> Vec<u8> {
2321
let msg = cx.body_bytes().await.unwrap();
2422
println!("Bytes: {:?}", msg);
2523
msg
2624
}
2725

28-
#[allow(unused_mut)] // Workaround clippy bug
2926
async fn echo_json(mut cx: Context<()>) -> EndpointResult {
3027
let msg = cx.body_json().await.client_err()?;
3128
println!("JSON: {:?}", msg);
3229
Ok(response::json(msg))
3330
}
3431

35-
#[allow(unused_mut)] // Workaround clippy bug
3632
async fn echo_form(mut cx: Context<()>) -> EndpointResult {
3733
let msg = cx.body_form().await?;
3834
println!("Form: {:?}", msg);

examples/src/cookies.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ async fn retrieve_cookie(mut cx: Context<()>) -> String {
66
format!("hello cookies: {:?}", cx.get_cookie("hello").unwrap())
77
}
88

9-
#[allow(unused_mut)] // Workaround clippy bug
109
async fn set_cookie(mut cx: Context<()>) {
1110
cx.set_cookie(Cookie::new("hello", "world")).unwrap();
1211
}
1312

14-
#[allow(unused_mut)] // Workaround clippy bug
1513
async fn remove_cookie(mut cx: Context<()>) {
1614
cx.remove_cookie(Cookie::named("hello")).unwrap();
1715
}

examples/src/messages.rs

-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ impl Database {
3737
}
3838
}
3939

40-
#[allow(unused_mut)] // Workaround clippy bug
4140
async fn new_message(mut cx: Context<Database>) -> EndpointResult<String> {
4241
let msg = cx.body_json().await.client_err()?;
4342
Ok(cx.state().insert(msg).to_string())
4443
}
4544

46-
#[allow(unused_mut)] // Workaround clippy bug
4745
async fn set_message(mut cx: Context<Database>) -> EndpointResult<()> {
4846
let msg = cx.body_json().await.client_err()?;
4947
let id = cx.param("id").client_err()?;

examples/src/multipart_form/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ struct Message {
99
file: Option<String>,
1010
}
1111

12-
#[allow(unused_mut)] // Workaround clippy bug
1312
async fn upload_file(mut cx: Context<()>) -> EndpointResult {
1413
// https://stackoverflow.com/questions/43424982/how-to-parse-multipart-forms-using-abonander-multipart-with-rocket
1514
let mut message = Message {

tide/src/middleware/cookies.rs

-4
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,19 @@ mod tests {
7272
static COOKIE_NAME: &str = "testCookie";
7373

7474
/// Tide will use the the `Cookies`'s `Extract` implementation to build this parameter.
75-
#[allow(unused_mut)] // Workaround clippy bug
7675
async fn retrieve_cookie(mut cx: Context<()>) -> String {
7776
format!("{}", cx.get_cookie(COOKIE_NAME).unwrap().unwrap().value())
7877
}
7978

80-
#[allow(unused_mut)] // Workaround clippy bug
8179
async fn set_cookie(mut cx: Context<()>) {
8280
cx.set_cookie(Cookie::new(COOKIE_NAME, "NewCookieValue"))
8381
.unwrap();
8482
}
8583

86-
#[allow(unused_mut)] // Workaround clippy bug
8784
async fn remove_cookie(mut cx: Context<()>) {
8885
cx.remove_cookie(Cookie::named(COOKIE_NAME)).unwrap();
8986
}
9087

91-
#[allow(unused_mut)] // Workaround clippy bug
9288
async fn set_multiple_cookie(mut cx: Context<()>) {
9389
cx.set_cookie(Cookie::new("C1", "V1")).unwrap();
9490
cx.set_cookie(Cookie::new("C2", "V2")).unwrap();

0 commit comments

Comments
 (0)