diff options
author | Jerome Gravel-Niquet <jeromegn@gmail.com> | 2020-04-25 07:51:29 -0400 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-04-25 14:02:49 +0200 |
commit | 4abebf55b37d51c4ce56a43445d357ac4f96699e (patch) | |
tree | 576a68fb436704ef6b34fffd371757b5dc72e62d /askama_shared | |
parent | c7a66e87f236d4bce2a4b442d107ff5250534f8a (diff) | |
download | askama-4abebf55b37d51c4ce56a43445d357ac4f96699e.tar.gz askama-4abebf55b37d51c4ce56a43445d357ac4f96699e.tar.bz2 askama-4abebf55b37d51c4ce56a43445d357ac4f96699e.zip |
Fix wrong num_traits cfg feature in askama_shared
Diffstat (limited to '')
-rw-r--r-- | askama_shared/src/filters/mod.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs index 64e1259..55ba84b 100644 --- a/askama_shared/src/filters/mod.rs +++ b/askama_shared/src/filters/mod.rs @@ -22,7 +22,7 @@ use crate::error::Error::Fmt; use askama_escape::{Escaper, MarkupDisplay}; #[cfg(feature = "humansize")] use humansize::{file_size_opts, FileSize}; -#[cfg(feature = "num_traits")] +#[cfg(feature = "num-traits")] use num_traits::{cast::NumCast, Signed}; #[cfg(feature = "percent-encoding")] use percent_encoding::{utf8_percent_encode, AsciiSet, NON_ALPHANUMERIC}; @@ -225,7 +225,7 @@ pub fn indent(s: &dyn fmt::Display, width: &usize) -> Result<String> { Ok(indented) } -#[cfg(feature = "num_traits")] +#[cfg(feature = "num-traits")] /// Casts number to f64 pub fn into_f64<T>(number: T) -> Result<f64> where @@ -234,7 +234,7 @@ where number.to_f64().ok_or(Fmt(fmt::Error)) } -#[cfg(feature = "num_traits")] +#[cfg(feature = "num-traits")] /// Casts number to isize pub fn into_isize<T>(number: T) -> Result<isize> where @@ -265,7 +265,7 @@ where Ok(rv) } -#[cfg(feature = "num_traits")] +#[cfg(feature = "num-traits")] /// Absolute value pub fn abs<T>(number: T) -> Result<T> where @@ -330,7 +330,7 @@ pub fn wordcount(s: &dyn fmt::Display) -> Result<usize> { #[cfg(test)] mod tests { use super::*; - #[cfg(feature = "num_traits")] + #[cfg(feature = "num-traits")] use std::f64::INFINITY; #[cfg(feature = "humansize")] @@ -434,7 +434,7 @@ mod tests { ); } - #[cfg(feature = "num_traits")] + #[cfg(feature = "num-traits")] #[test] #[allow(clippy::float_cmp)] fn test_into_f64() { @@ -445,7 +445,7 @@ mod tests { assert_eq!(into_f64(-INFINITY as f32).unwrap(), -INFINITY); } - #[cfg(feature = "num_traits")] + #[cfg(feature = "num-traits")] #[test] fn test_into_isize() { assert_eq!(into_isize(1).unwrap(), 1 as isize); @@ -492,7 +492,7 @@ mod tests { ); } - #[cfg(feature = "num_traits")] + #[cfg(feature = "num-traits")] #[test] #[allow(clippy::float_cmp)] fn test_abs() { |