Skip to content

Commit

Permalink
Support Rust 2021 edition in macro codegen (#316)
Browse files Browse the repository at this point in the history
Fix a codegen issue with hydration producing invalid syntax in Rust 2021 edition.
  • Loading branch information
utherpally authored Dec 14, 2021
1 parent 10a9a83 commit 6572ea5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sycamore-macro/src/view/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl ToTokens for Element {
let initial = if cfg!(feature = "experimental-hydrate") {
quote! {
if ::std::any::Any::type_id(&__el) == ::std::any::TypeId::of::<::sycamore::HydrateNode>() {
let __el = ::std::any::Any::downcast_ref::<::sycamore::HydrateNode>(&__el).unwrap();
let __el = <dyn ::std::any::Any>::downcast_ref::<::sycamore::HydrateNode>(&__el).unwrap();
let __initial = ::sycamore::utils::hydrate::web::get_next_marker(&__el.inner_element());
// Do not drop the HydrateNode because it will be cast into a GenericNode.
let __initial = ::std::mem::ManuallyDrop::new(__initial);
Expand Down

0 comments on commit 6572ea5

Please sign in to comment.