Skip to content

Commit

Permalink
(refactor) remove block context from value enum
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Jan 22, 2020
1 parent d54b33f commit 6a4aeb1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/json/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ pub enum ScopedJson<'reg: 'rc, 'rc> {
Derived(Json),
// represents a json reference to context value, its full path
Context(&'rc Json, Vec<String>),
// represents a block param json with resolve full path
// this path is different from `PathAndJson`
// TODO: merge this with context?
BlockContext(&'rc Json, Vec<String>),
Missing,
}

Expand All @@ -29,7 +25,6 @@ impl<'reg: 'rc, 'rc> ScopedJson<'reg, 'rc> {
ScopedJson::Constant(j) => j,
ScopedJson::Derived(ref j) => j,
ScopedJson::Context(j, _) => j,
ScopedJson::BlockContext(j, _) => j,
_ => &DEFAULT_VALUE,
}
}
Expand All @@ -52,7 +47,7 @@ impl<'reg: 'rc, 'rc> ScopedJson<'reg, 'rc> {

pub fn context_path(&self) -> Option<&Vec<String>> {
match self {
ScopedJson::BlockContext(_, ref p) | ScopedJson::Context(_, ref p) => Some(p),
ScopedJson::Context(_, ref p) => Some(p),
_ => None,
}
}
Expand Down

0 comments on commit 6a4aeb1

Please sign in to comment.