Skip to content

Commit

Permalink
Merge #11
Browse files Browse the repository at this point in the history
11: Clean up / remove serde optional dependency r=nathanwhit a=nathanwhit



Co-authored-by: Nathan Whitaker <[email protected]>
  • Loading branch information
bors[bot] and nathanwhit committed Jul 5, 2020
2 parents a327853 + f1c60fb commit 320db3a
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/target
**/*.rs.bk
Cargo.lock
yaml-test-suite
91 changes: 91 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2018"
license = "MIT OR Apache-2.0"

[dependencies]
serde = {version = "1.0.104", features = ['derive'], optional = true}

[dev-dependencies]
paste = "0.1.6"
Expand Down
14 changes: 4 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ use parse::Parser;
use tokenize::Tokenizer;

use std::{fmt, fmt::Display};
#[cfg_attr(
any(test, feature = "serde"),
derive(serde::Deserialize, serde::Serialize)
)]
#[cfg_attr(test, derive(serde::Deserialize, serde::Serialize))]
#[derive(Clone, Debug, PartialEq, Eq)]
/// A Yaml Element
pub enum Yaml<'a> {
Expand Down Expand Up @@ -147,18 +144,15 @@ impl Display for Yaml<'_> {
print_yaml(&self, 0, f, PrintStyle::Block)
}
}
#[cfg_attr(
any(test, feature = "serde"),
derive(serde::Deserialize, serde::Serialize)
)]
#[cfg_attr(test, derive(serde::Deserialize, serde::Serialize))]
#[derive(Clone, Debug, PartialEq, Eq)]
/// A Yaml map entry
pub struct Entry<'a> {
/// The key associated with the entry
#[cfg_attr(any(test, feature = "serde"), serde(borrow))]
#[cfg_attr(test, serde(borrow))]
pub key: Yaml<'a>,
/// The value which the key maps to
#[cfg_attr(any(test, feature = "serde"), serde(borrow))]
#[cfg_attr(test, serde(borrow))]
pub value: Yaml<'a>,
}

Expand Down
4 changes: 0 additions & 4 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ impl<'a, 'b> Parser<'a, 'b> {
})
}

fn context(&self) -> Option<&ParseContext> {
self.contexts.last()
}

fn start_context(&mut self, context: ParseContext) {
self.contexts.push(context)
}
Expand Down

0 comments on commit 320db3a

Please sign in to comment.