Skip to content

Commit

Permalink
fix warnings after upgrading to rustc 1.81
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDC committed Sep 6, 2024
1 parent 27df102 commit 7699b92
Show file tree
Hide file tree
Showing 20 changed files with 17 additions and 41 deletions.
1 change: 0 additions & 1 deletion rama-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
2 changes: 1 addition & 1 deletion rama-haproxy/src/protocol/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn parse_header(header: &str) -> Result<Header, ParseError> {
}

let mut iterator = header
.splitn(PARTS, |c| c == SEPARATOR || c == CARRIAGE_RETURN)
.splitn(PARTS, [SEPARATOR, CARRIAGE_RETURN])
.peekable();

let prefix = iterator.next().ok_or(ParseError::MissingPrefix)?;
Expand Down
1 change: 0 additions & 1 deletion rama-http-backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-http-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
15 changes: 6 additions & 9 deletions rama-http/src/service/web/endpoint/extract/body/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ mod test {
age: u8,
}

let service = WebService::default().post("/", |Form(_): Form<Input>| async move {
panic!("should not reach here");
});
let service =
WebService::default().post("/", |Form(_): Form<Input>| async move { StatusCode::OK });

let req = Request::builder()
.uri("/")
Expand All @@ -136,9 +135,8 @@ mod test {
age: u8,
}

let service = WebService::default().get("/", |Form(_): Form<Input>| async move {
panic!("should not reach here");
});
let service =
WebService::default().get("/", |Form(_): Form<Input>| async move { StatusCode::OK });

let req = Request::builder()
.uri("/")
Expand Down Expand Up @@ -181,9 +179,8 @@ mod test {
age: u8,
}

let service = WebService::default().get("/", |Form(_): Form<Input>| async move {
panic!("should not reach here");
});
let service =
WebService::default().get("/", |Form(_): Form<Input>| async move { StatusCode::OK });

let req = Request::builder()
.uri("/?name=Devan")
Expand Down
10 changes: 4 additions & 6 deletions rama-http/src/service/web/endpoint/extract/body/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ mod test {
_alive: Option<bool>,
}

let service = WebService::default().post("/", |Json(_): Json<Input>| async move {
unreachable!("This endpoint should not be called");
});
let service =
WebService::default().post("/", |Json(_): Json<Input>| async move { StatusCode::OK });

let req = http::Request::builder()
.method(http::Method::POST)
Expand All @@ -130,9 +129,8 @@ mod test {
_alive: Option<bool>,
}

let service = WebService::default().post("/", |Json(_): Json<Input>| async move {
unreachable!("This endpoint should not be called");
});
let service =
WebService::default().post("/", |Json(_): Json<Input>| async move { StatusCode::OK });

let req = http::Request::builder()
.method(http::Method::POST)
Expand Down
15 changes: 6 additions & 9 deletions rama-http/src/service/web/endpoint/extract/body/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ mod test {

#[tokio::test]
async fn test_text_missing_content_type() {
let service = WebService::default().post("/", |Text(_): Text| async move {
unreachable!();
});
let service =
WebService::default().post("/", |Text(_): Text| async move { StatusCode::OK });

let req = Request::builder()
.method(Method::POST)
Expand All @@ -102,9 +101,8 @@ mod test {

#[tokio::test]
async fn test_text_incorrect_content_type() {
let service = WebService::default().post("/", |Text(_): Text| async move {
unreachable!();
});
let service =
WebService::default().post("/", |Text(_): Text| async move { StatusCode::OK });

let req = Request::builder()
.method(Method::POST)
Expand All @@ -117,9 +115,8 @@ mod test {

#[tokio::test]
async fn test_text_invalid_utf8() {
let service = WebService::default().post("/", |Text(_): Text| async move {
unreachable!();
});
let service =
WebService::default().post("/", |Text(_): Text| async move { StatusCode::OK });

let req = Request::builder()
.method(Method::POST)
Expand Down
1 change: 0 additions & 1 deletion rama-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-net/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-socks5/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-tcp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-tls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-ua/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-udp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion rama-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@
clippy::needless_borrow,
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::mismatched_target_os,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
Expand Down

0 comments on commit 7699b92

Please sign in to comment.