diff --git a/axum/src/extract/path/de.rs b/axum/src/extract/path/de.rs index a4d44596..a33f5cf1 100644 --- a/axum/src/extract/path/de.rs +++ b/axum/src/extract/path/de.rs @@ -744,6 +744,7 @@ mod tests { #[test] fn test_parse_error_at_key_error() { #[derive(Debug, Deserialize)] + #[allow(dead_code)] struct Params { a: u32, } @@ -761,6 +762,7 @@ mod tests { #[test] fn test_parse_error_at_key_error_multiple() { #[derive(Debug, Deserialize)] + #[allow(dead_code)] struct Params { a: u32, b: u32, diff --git a/examples/async-graphql/src/starwars/model.rs b/examples/async-graphql/src/starwars/model.rs index 80f562f1..c17f234f 100644 --- a/examples/async-graphql/src/starwars/model.rs +++ b/examples/async-graphql/src/starwars/model.rs @@ -122,12 +122,7 @@ impl QueryRoot { first: Option<i32>, last: Option<i32>, ) -> FieldResult<Connection<usize, Human, EmptyFields, EmptyFields>> { - let humans = ctx - .data_unchecked::<StarWars>() - .humans() - .iter() - .copied() - .collect::<Vec<_>>(); + let humans = ctx.data_unchecked::<StarWars>().humans().to_vec(); query_characters(after, before, first, last, &humans) .await .map(|conn| conn.map_node(Human)) @@ -149,12 +144,7 @@ impl QueryRoot { first: Option<i32>, last: Option<i32>, ) -> FieldResult<Connection<usize, Droid, EmptyFields, EmptyFields>> { - let droids = ctx - .data_unchecked::<StarWars>() - .droids() - .iter() - .copied() - .collect::<Vec<_>>(); + let droids = ctx.data_unchecked::<StarWars>().droids().to_vec(); query_characters(after, before, first, last, &droids) .await .map(|conn| conn.map_node(Droid)) diff --git a/examples/validator/src/main.rs b/examples/validator/src/main.rs index 32771ddf..2d9e65d2 100644 --- a/examples/validator/src/main.rs +++ b/examples/validator/src/main.rs @@ -86,7 +86,7 @@ impl IntoResponse for ServerError { fn into_response(self) -> Response { match self { ServerError::ValidationError(_) => { - let message = format!("Input validation error: [{}]", self).replace("\n", ", "); + let message = format!("Input validation error: [{}]", self).replace('\n', ", "); (StatusCode::BAD_REQUEST, message) } ServerError::AxumFormRejection(_) => (StatusCode::BAD_REQUEST, self.to_string()),