Skip to content

Commit

Permalink
rename crate
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelang committed May 6, 2019
1 parent 626a322 commit ae19ca6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
members = [
"bindings/rust/evmc-sys",
"bindings/rust/evmc-vm",
"bindings/rust/evmc-bind",
"bindings/rust/evmc-declare",
"examples/example-rust-vm"
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "evmc-bind"
name = "evmc-declare"
version = "0.1.0"
authors = ["Jake Lang <jak3lang@gmail.com>"]
edition = "2018"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use syn::MetaList;
use syn::NestedMeta;

#[proc_macro_attribute]
pub fn evmc_raw(args: TokenStream, item: TokenStream) -> TokenStream {
pub fn evmc_declare_vm(args: TokenStream, item: TokenStream) -> TokenStream {
// First, try to parse the input token stream into an AST node representing a struct
// declaration.
let input: ItemStruct = parse_macro_input!(item as ItemStruct);
Expand All @@ -38,7 +38,7 @@ pub fn evmc_raw(args: TokenStream, item: TokenStream) -> TokenStream {
// If we have more than one argument, throw a compile error. Otherwise, extract the item
// and try to form a valid stylized name from it.
if meta.nested.len() != 1 {
panic!("More than one meta-item supplied to evmc_raw")
panic!("More than one meta-item supplied to evmc_declare_vm")
} else {
match meta
.nested
Expand All @@ -51,15 +51,15 @@ pub fn evmc_raw(args: TokenStream, item: TokenStream) -> TokenStream {
if let Meta::Word(id) = m {
id.to_string()
} else {
panic!("Meta-item passed to evmc_raw is not a valid identifier")
panic!("Meta-item passed to evmc_declare_vm is not a valid identifier")
}
}
NestedMeta::Literal(l) => {
// Try to extract a valid UTF-8 string if a literal was supplied.
if let Lit::Str(s) = l {
s.value()
} else {
panic!("Literal passed to evmc_raw is not a valid UTF-8 string literal")
panic!("Literal passed to evmc_declare_vm is not a valid UTF-8 string literal")
}
}
}
Expand Down

0 comments on commit ae19ca6

Please sign in to comment.