Skip to content

Commit 6680160

Browse files
authored
Fix deprecated lints (#608)
1 parent 81b8231 commit 6680160

File tree

6 files changed

+10
-19
lines changed

6 files changed

+10
-19
lines changed

tower-http/src/cors/allow_headers.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{array, fmt};
1+
use std::fmt;
22

33
use http::{
44
header::{self, HeaderName, HeaderValue},
@@ -88,8 +88,7 @@ impl From<Any> for AllowHeaders {
8888

8989
impl<const N: usize> From<[HeaderName; N]> for AllowHeaders {
9090
fn from(arr: [HeaderName; N]) -> Self {
91-
#[allow(deprecated)] // Can be changed when MSRV >= 1.53
92-
Self::list(array::IntoIter::new(arr))
91+
Self::list(arr)
9392
}
9493
}
9594

tower-http/src/cors/allow_methods.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{array, fmt};
1+
use std::fmt;
22

33
use http::{
44
header::{self, HeaderName, HeaderValue},
@@ -108,8 +108,7 @@ impl From<Method> for AllowMethods {
108108

109109
impl<const N: usize> From<[Method; N]> for AllowMethods {
110110
fn from(arr: [Method; N]) -> Self {
111-
#[allow(deprecated)] // Can be changed when MSRV >= 1.53
112-
Self::list(array::IntoIter::new(arr))
111+
Self::list(arr)
113112
}
114113
}
115114

tower-http/src/cors/allow_origin.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use http::{
44
};
55
use pin_project_lite::pin_project;
66
use std::{
7-
array, fmt,
7+
fmt,
88
future::Future,
99
pin::Pin,
1010
sync::Arc,
@@ -203,8 +203,7 @@ impl From<HeaderValue> for AllowOrigin {
203203

204204
impl<const N: usize> From<[HeaderValue; N]> for AllowOrigin {
205205
fn from(arr: [HeaderValue; N]) -> Self {
206-
#[allow(deprecated)] // Can be changed when MSRV >= 1.53
207-
Self::list(array::IntoIter::new(arr))
206+
Self::list(arr)
208207
}
209208
}
210209

tower-http/src/cors/expose_headers.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{array, fmt};
1+
use std::fmt;
22

33
use http::{
44
header::{self, HeaderName, HeaderValue},
@@ -71,8 +71,7 @@ impl From<Any> for ExposeHeaders {
7171

7272
impl<const N: usize> From<[HeaderName; N]> for ExposeHeaders {
7373
fn from(arr: [HeaderName; N]) -> Self {
74-
#[allow(deprecated)] // Can be changed when MSRV >= 1.53
75-
Self::list(array::IntoIter::new(arr))
74+
Self::list(arr)
7675
}
7776
}
7877

tower-http/src/cors/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ use http::{
5757
};
5858
use pin_project_lite::pin_project;
5959
use std::{
60-
array,
6160
future::Future,
6261
mem,
6362
pin::Pin,
@@ -813,8 +812,7 @@ fn ensure_usable_cors_rules(layer: &CorsLayer) {
813812
///
814813
/// This is the default set of header names returned in the `vary` header
815814
pub fn preflight_request_headers() -> impl Iterator<Item = HeaderName> {
816-
#[allow(deprecated)] // Can be changed when MSRV >= 1.53
817-
array::IntoIter::new([
815+
IntoIterator::into_iter([
818816
header::ORIGIN,
819817
header::ACCESS_CONTROL_REQUEST_METHOD,
820818
header::ACCESS_CONTROL_REQUEST_HEADERS,

tower-http/src/cors/vary.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::array;
2-
31
use http::header::{self, HeaderName, HeaderValue};
42

53
use super::preflight_request_headers;
@@ -48,8 +46,7 @@ impl Default for Vary {
4846

4947
impl<const N: usize> From<[HeaderName; N]> for Vary {
5048
fn from(arr: [HeaderName; N]) -> Self {
51-
#[allow(deprecated)] // Can be changed when MSRV >= 1.53
52-
Self::list(array::IntoIter::new(arr))
49+
Self::list(arr)
5350
}
5451
}
5552

0 commit comments

Comments
 (0)