summaryrefslogtreecommitdiff
path: root/src/library/maps.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/maps.rs')
-rw-r--r--src/library/maps.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/library/maps.rs b/src/library/maps.rs
index 4eafd9cc..13b4dc5d 100644
--- a/src/library/maps.rs
+++ b/src/library/maps.rs
@@ -31,13 +31,6 @@ impl<K, V> ConsistentMap<K, V> where K: Hash + Eq {
})
}
- /// Add a key-spanned-value pair the value is not `None`.
- pub fn add_opt_span(&mut self, key: K, value: Option<Spanned<V>>) -> ParseResult<()> {
- Ok(if let Some(spanned) = value {
- self.add(key, spanned.v)?;
- })
- }
-
/// Call a function with the value if the key is present.
pub fn with<F>(&self, key: K, callback: F) where F: FnOnce(&V) {
if let Some(value) = self.map.get(&key) {
@@ -143,7 +136,7 @@ impl PaddingMap {
pub fn new(args: &mut FuncArgs, enforce: bool) -> ParseResult<PaddingMap> {
let mut map = ConsistentMap::new();
- map.add_opt_span(PaddingKey::All, args.get_pos_opt::<Size>()?)?;
+ map.add_opt(PaddingKey::All, args.get_pos_opt::<Size>()?)?;
for arg in args.keys() {
let key = match PaddingKey::from_ident(&arg.v.key) {