1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 16:29:02 +02:00

address msrv todo in router

This commit is contained in:
Rob Ede
2021-04-16 02:06:11 +01:00
parent aeb81ad3fd
commit 7749dfe46a
4 changed files with 4 additions and 7 deletions

View File

@ -581,10 +581,7 @@ impl ResourceDef {
mut for_prefix: bool,
) -> (String, Vec<PatternElement>, bool, usize) {
if pattern.find('{').is_none() {
// TODO: MSRV: 1.45
#[allow(clippy::manual_strip)]
return if pattern.ends_with('*') {
let path = &pattern[..pattern.len() - 1];
return if let Some(path) = pattern.strip_suffix('*') {
let re = String::from("^") + path + "(.*)";
(re, vec![PatternElement::Str(String::from(path))], true, 0)
} else {