Skip to content

Commit

Permalink
builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljordan committed Dec 27, 2024
1 parent 280ff2e commit d02336b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stylus-proc/src/macros/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn top_level_storage_impl(item: &syn::ItemStruct) -> syn::ItemImpl {
fn struct_entrypoint_fn(name: &Ident) -> syn::ItemFn {
parse_quote! {
fn #STRUCT_ENTRYPOINT_FN<H: Host>(input: alloc::vec::Vec<u8>, host: Rc<H>) -> stylus_sdk::ArbResult {
stylus_sdk::abi::router_entrypoint::<#name, #name, H>(input, host)
stylus_sdk::abi::router_entrypoint::<#name<H>, #name<H>, H>(input, host)
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion stylus-proc/src/macros/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ impl StorageField {
return None;
};
let ty = &self.ty;
if ty.to_token_stream().to_string() == "Rc < H >".to_string() {

Check warning on line 169 in stylus-proc/src/macros/storage.rs

View workflow job for this annotation

GitHub Actions / clippy

this creates an owned instance just for comparison

warning: this creates an owned instance just for comparison --> stylus-proc/src/macros/storage.rs:169:48 | 169 | if ty.to_token_stream().to_string() == "Rc < H >".to_string() { | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `*"Rc < H >"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned = note: `#[warn(clippy::cmp_owned)]` on by default

Check warning on line 169 in stylus-proc/src/macros/storage.rs

View workflow job for this annotation

GitHub Actions / clippy

this creates an owned instance just for comparison

warning: this creates an owned instance just for comparison --> stylus-proc/src/macros/storage.rs:169:48 | 169 | if ty.to_token_stream().to_string() == "Rc < H >".to_string() { | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `*"Rc < H >"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned = note: `#[warn(clippy::cmp_owned)]` on by default
return None;
}
Some(parse_quote! {
#ident: {
let bytes = <#ty as storage::StorageType<H>>::SLOT_BYTES;
Expand All @@ -177,7 +180,7 @@ impl StorageField {
space -= bytes;

let root = root + alloy_primitives::U256::from(slot);
let field = <#ty as storage::StorageType<H>>::new(root, space as u8, Rc::clone(&self.host));
let field = <#ty as storage::StorageType<H>>::new(root, space as u8, Rc::clone(&host));
if words > 0 {
slot += words;
space = 32;
Expand All @@ -189,6 +192,9 @@ impl StorageField {

fn size(&self) -> TokenStream {
let ty = &self.ty;
if ty.to_token_stream().to_string() == "Rc < H >".to_string() {

Check warning on line 195 in stylus-proc/src/macros/storage.rs

View workflow job for this annotation

GitHub Actions / clippy

this creates an owned instance just for comparison

warning: this creates an owned instance just for comparison --> stylus-proc/src/macros/storage.rs:195:48 | 195 | if ty.to_token_stream().to_string() == "Rc < H >".to_string() { | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `*"Rc < H >"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned

Check warning on line 195 in stylus-proc/src/macros/storage.rs

View workflow job for this annotation

GitHub Actions / clippy

this creates an owned instance just for comparison

warning: this creates an owned instance just for comparison --> stylus-proc/src/macros/storage.rs:195:48 | 195 | if ty.to_token_stream().to_string() == "Rc < H >".to_string() { | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `*"Rc < H >"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
return quote! {};
}
quote! {
let bytes = <#ty as storage::StorageType<H>>::SLOT_BYTES;
let words = <#ty as storage::StorageType<H>>::REQUIRED_SLOTS;
Expand Down
2 changes: 1 addition & 1 deletion stylus-sdk/src/storage/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ pub trait GlobalStorage<H: Host> {

if B == 256 {
return Self::set_word(
host,
Rc::clone(&host),
key,
FixedBytes::from_slice(&value.to_be_bytes::<32>()),
);
Expand Down

0 comments on commit d02336b

Please sign in to comment.