diff options
author | Juan Aguilar Santillana <mhpoin@gmail.com> | 2018-12-01 00:52:41 +0100 |
---|---|---|
committer | Juan Aguilar <mhpoin@gmail.com> | 2018-12-01 22:31:12 +0100 |
commit | 94db5b1cb6a99f46b05f4397e33a18e30409eba8 (patch) | |
tree | 90a6b5fddbd90ec602b27330e0a19ba5305fbc0f | |
parent | 768c571f9d8be06ad6dae4b961fcf7070e73edbd (diff) | |
download | askama-94db5b1cb6a99f46b05f4397e33a18e30409eba8.tar.gz askama-94db5b1cb6a99f46b05f4397e33a18e30409eba8.tar.bz2 askama-94db5b1cb6a99f46b05f4397e33a18e30409eba8.zip |
Fix unnecessary len at capitalize filter
Diffstat (limited to '')
-rw-r--r-- | askama_shared/src/filters/mod.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs index 672c5b3..a001357 100644 --- a/askama_shared/src/filters/mod.rs +++ b/askama_shared/src/filters/mod.rs @@ -224,15 +224,12 @@ pub fn capitalize(s: &fmt::Display) -> Result<String> { &*s }) { None => Ok(s), - _ => { - let l = s.len(); - match s.get_mut(1..l).map(|s| { - s.make_ascii_lowercase(); - &*s - }) { - _ => Ok(s), - } - } + _ => match s.get_mut(1..).map(|s| { + s.make_ascii_lowercase(); + &*s + }) { + _ => Ok(s), + }, } } |