Remove some surface area from Delimited api
diff --git a/src/attr.rs b/src/attr.rs
index 375904e..13e1867 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -65,7 +65,7 @@
/// Parses the tokens after the path as a [`MetaItem`](enum.MetaItem.html) if possible.
pub fn meta_item(&self) -> Option<MetaItem> {
let name = if self.path.segments.len() == 1 {
- &self.path.segments.get(0).item().ident
+ &self.path.segments.first().unwrap().item().ident
} else {
return None;
};
@@ -187,10 +187,10 @@
Some(pair) => pair,
None => return None,
};
- match prev_comma {
- Some(comma) => delimited.push_next(nested, comma),
- None => delimited.push_first(nested),
+ if let Some(comma) = prev_comma {
+ delimited.push_trailing(comma);
}
+ delimited.push(nested);
tts = rest;
}