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

Allow specifying absolute crate path #22

Merged
merged 1 commit into from
Aug 11, 2020
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 impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use std::hash::Hasher;
use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;
use syn::parse::{Parse, ParseStream, Result};
use syn::{bracketed, parse_macro_input, Token};
use syn::{bracketed, parse_macro_input, Token, Path};

struct Input {
krate: Option<Ident>,
krate: Option<Path>,
expr: TokenStream,
}

Expand All @@ -25,7 +25,7 @@ impl Parse for Input {
bracketed!(content in input);
content.parse::<Token![crate]>()?;
content.parse::<Token![=]>()?;
let krate: Ident = content.parse()?;
let krate = content.parse()?;
Some(krate)
} else {
None
Expand Down