Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix following removal of parse_ty_path #138

Merged
merged 1 commit into from
Mar 23, 2017
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
13 changes: 6 additions & 7 deletions src/plugins/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn ty_snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<MacRe
// The `expand_expr` method is called so that any macro calls in the
// parsed expression are expanded.

let mut ty = match parser.parse_ty_path() {
let mut path = match parser.parse_path(PathStyle::Type) {
Ok(s) => s,
Err(mut diagnostic) => {
diagnostic.emit();
Expand All @@ -123,14 +123,13 @@ fn ty_snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<MacRe
}

// Only capitalize the final segment
if let TyKind::Path(_, ref mut path) = ty {
convert(&mut path.segments.last_mut().unwrap().identifier);
} else {
unreachable!()
}
convert(&mut path.segments
.last_mut()
.unwrap()
.identifier);
MacEager::ty(P(Ty {
id: ast::DUMMY_NODE_ID,
node: ty,
node: TyKind::Path(None, path),
span: sp,
}))
}
Expand Down