1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 18:02:58 +01:00

fix examples on msrv

This commit is contained in:
Rob Ede 2021-07-17 03:11:25 +01:00
parent 95cba659ff
commit e4ec956001
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933

View File

@ -135,21 +135,18 @@ macro_rules! register {
concat!("/user/keys"), concat!("/user/keys"),
concat!("/user/keys/", $p1), concat!("/user/keys/", $p1),
]; ];
std::array::IntoIter::new(arr)
arr.to_vec()
}}; }};
} }
fn call() -> impl Iterator<Item = &'static str> { static PATHS: [&'static str; 5] = [
let arr = [ "/authorizations",
"/authorizations", "/user/repos",
"/user/repos", "/repos/rust-lang/rust/stargazers",
"/repos/rust-lang/rust/stargazers", "/orgs/rust-lang/public_members/nikomatsakis",
"/orgs/rust-lang/public_members/nikomatsakis", "/repos/rust-lang/rust/releases/1.51.0",
"/repos/rust-lang/rust/releases/1.51.0", ];
];
std::array::IntoIter::new(arr)
}
fn main() { fn main() {
let mut router = actix_router::Router::<bool>::build(); let mut router = actix_router::Router::<bool>::build();
@ -162,7 +159,7 @@ fn main() {
if firestorm::enabled() { if firestorm::enabled() {
firestorm::bench("target", || { firestorm::bench("target", || {
for route in call() { for &route in &PATHS {
let mut path = actix_router::Path::new(route); let mut path = actix_router::Path::new(route);
actix.recognize(&mut path).unwrap(); actix.recognize(&mut path).unwrap();
} }