aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-12-07 16:05:02 +0100
committerLibravatar Juan Aguilar <mhpoin@gmail.com>2018-12-07 19:41:48 +0100
commit93136a66edcddab7c7800ad487c29d2cb57b713b (patch)
tree9b5b558125d2ec42571f01692c3a0f8ddff091bc /askama_shared
parentd42c5c04aa26ca72ab84760b9425891f316bae0a (diff)
downloadaskama-93136a66edcddab7c7800ad487c29d2cb57b713b.tar.gz
askama-93136a66edcddab7c7800ad487c29d2cb57b713b.tar.bz2
askama-93136a66edcddab7c7800ad487c29d2cb57b713b.zip
Fix typo in serde_json feature
Diffstat (limited to 'askama_shared')
-rw-r--r--askama_shared/src/error.rs12
-rw-r--r--askama_shared/src/filters/json.rs3
-rw-r--r--askama_shared/src/filters/mod.rs4
-rw-r--r--askama_shared/src/lib.rs2
4 files changed, 10 insertions, 11 deletions
diff --git a/askama_shared/src/error.rs b/askama_shared/src/error.rs
index df175cd..90ba571 100644
--- a/askama_shared/src/error.rs
+++ b/askama_shared/src/error.rs
@@ -7,7 +7,7 @@ pub type Result<I> = ::std::result::Result<I, Error>;
///
/// # Feature Interaction
///
-/// If the feature `serde-json` is enabled an
+/// If the feature `serde_json` is enabled an
/// additional error variant `Json` is added.
///
/// # Why not `failure`/`error-chain`?
@@ -29,7 +29,7 @@ pub enum Error {
Fmt(fmt::Error),
/// json conversion error
- #[cfg(feature = "serde-json")]
+ #[cfg(feature = "serde_json")]
Json(::serde_json::Error),
/// This error needs to be non-exhaustive as
@@ -43,7 +43,7 @@ impl ErrorTrait for Error {
fn description(&self) -> &str {
match *self {
Error::Fmt(ref err) => err.description(),
- #[cfg(feature = "serde-json")]
+ #[cfg(feature = "serde_json")]
Error::Json(ref err) => err.description(),
_ => "unknown error: __Nonexhaustive",
}
@@ -52,7 +52,7 @@ impl ErrorTrait for Error {
fn cause(&self) -> Option<&ErrorTrait> {
match *self {
Error::Fmt(ref err) => err.cause(),
- #[cfg(feature = "serde-json")]
+ #[cfg(feature = "serde_json")]
Error::Json(ref err) => err.cause(),
_ => None,
}
@@ -64,7 +64,7 @@ impl Display for Error {
match *self {
Error::Fmt(ref err) => write!(formatter, "formatting error: {}", err),
- #[cfg(feature = "serde-json")]
+ #[cfg(feature = "serde_json")]
Error::Json(ref err) => write!(formatter, "json conversion error: {}", err),
_ => write!(formatter, "unknown error: __Nonexhaustive"),
}
@@ -77,7 +77,7 @@ impl From<fmt::Error> for Error {
}
}
-#[cfg(feature = "serde-json")]
+#[cfg(feature = "serde_json")]
impl From<::serde_json::Error> for Error {
fn from(err: ::serde_json::Error) -> Self {
Error::Json(err)
diff --git a/askama_shared/src/filters/json.rs b/askama_shared/src/filters/json.rs
index 85d4a32..2df6db6 100644
--- a/askama_shared/src/filters/json.rs
+++ b/askama_shared/src/filters/json.rs
@@ -1,9 +1,8 @@
use error::{Error, Result};
use serde::Serialize;
-use serde_json;
use MarkupDisplay;
-/// Serialize to JSON (requires `serde-json` feature)
+/// Serialize to JSON (requires `serde_json` feature)
///
/// ## Errors
///
diff --git a/askama_shared/src/filters/mod.rs b/askama_shared/src/filters/mod.rs
index a001357..cf94092 100644
--- a/askama_shared/src/filters/mod.rs
+++ b/askama_shared/src/filters/mod.rs
@@ -4,10 +4,10 @@
//! You can define your own filters; for more information,
//! see the top-level crate documentation.
-#[cfg(feature = "serde-json")]
+#[cfg(feature = "serde_json")]
mod json;
-#[cfg(feature = "serde-json")]
+#[cfg(feature = "serde_json")]
pub use self::json::json;
use askama_escape::MarkupDisplay;
diff --git a/askama_shared/src/lib.rs b/askama_shared/src/lib.rs
index a8839fa..07967f4 100644
--- a/askama_shared/src/lib.rs
+++ b/askama_shared/src/lib.rs
@@ -6,7 +6,7 @@ extern crate num_traits;
extern crate serde;
#[macro_use]
extern crate serde_derive;
-#[cfg(feature = "serde-json")]
+#[cfg(feature = "serde_json")]
extern crate serde_json;
extern crate toml;