Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Update for recent changes in libsyntax #134

Merged
merged 1 commit into from
Jul 29, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docopt_macros/src/macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<'a, 'b> MacParser<'a, 'b> {
&token::Eof, sep, |p| MacParser::parse_type_annotation(p)
)).into_iter()
.map(|(ident, ty)| {
let field_name = token::get_ident(ident).to_string();
let field_name = ident.to_string();
let key = ArgvMap::struct_field_to_key(&*field_name);
(Atom::new(&*key), ty)
})
Expand Down Expand Up @@ -259,15 +259,15 @@ impl<'a, 'b> MacParser<'a, 'b> {
};
if try!(self.p.eat(&token::Comma)) { return Ok(info); }
let deriving = try!(self.p.parse_ident());
if deriving.as_str() != "derive" {
if deriving.name != "derive" {
let err = format!("Expected 'derive' keyword but got '{}'",
deriving);
self.cx.span_err(self.cx.call_site(), &*err);
return Err(FatalError);
}
while !try!(self.p.eat(&token::Comma)) {
info.deriving.push(
try!(self.p.parse_ident()).as_str().to_string());
try!(self.p.parse_ident()).name.to_string());
}
Ok(info)
}
Expand Down