summaryrefslogtreecommitdiff
path: root/src/syntax/decoration.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-02 16:56:14 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-02 16:56:14 +0200
commitd5ff97f42ed1e682a66ea8d51e5f9ed1be547b9c (patch)
tree2fdc3a368c4320051e3f62a460f3912fe5f44c7c /src/syntax/decoration.rs
parent533374db14087ac54fdc86afa5f009487ac1b850 (diff)
Move binary into separate crate and tidy dependencies 🎭
Diffstat (limited to 'src/syntax/decoration.rs')
-rw-r--r--src/syntax/decoration.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/syntax/decoration.rs b/src/syntax/decoration.rs
index ab327237..13a9ad36 100644
--- a/src/syntax/decoration.rs
+++ b/src/syntax/decoration.rs
@@ -1,14 +1,17 @@
//! Decorations for semantic syntax highlighting.
+#[cfg(feature = "serialize")]
use serde::Serialize;
+
use super::span::SpanVec;
/// A list of spanned decorations.
pub type Decorations = SpanVec<Decoration>;
/// Decorations for semantic syntax highlighting.
-#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Serialize)]
-#[serde(rename_all = "camelCase")]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
+#[cfg_attr(feature = "serialize", derive(Serialize))]
+#[cfg_attr(feature = "serialize", serde(rename_all = "camelCase"))]
pub enum Decoration {
/// A valid function name.
/// ```typst