Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
fmt
  • Loading branch information
dvdplm committed Mar 12, 2021
commit 939d1b9f2bb6298b5a44fed9533000c41f359853
2 changes: 1 addition & 1 deletion derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn crate_name_ident(name: &str) -> Result<Ident> {
use proc_macro_crate::FoundCrate::*;
match crate_name {
Itself => Ident::new("self", Span::call_site()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Itself => Ident::new("self", Span::call_site()),
Itself => Ident::new("crate", Span::call_site()),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't crate the right keyword then? Actually I wonder if crate as Ident is allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not, which is why I switched to a token stream in the other PR.

My plan was to merge this change here and then merge it into the other and sort out the Itself-case there.

Name(name) => Ident::new(&name, Span::call_site()),
Name(name) => Ident::new(&name, Span::call_site()),
}
})
.map_err(|e| syn::Error::new(Span::call_site(), &e))
Expand Down