Skip to content

Commit

Permalink
no implicit prelude.
Browse files Browse the repository at this point in the history
  • Loading branch information
futursolo committed Apr 15, 2022
1 parent 1d7512e commit 4ad2b71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
@@ -1,8 +1,8 @@
use yew::prelude::*;
#![no_implicit_prelude]

#[hook]
fn use_boxed_fn(_f: Box<dyn Fn(&str) -> &str>) {
todo!()
#[::yew::prelude::hook]
fn use_boxed_fn(_f: ::std::boxed::Box<dyn::std::ops::Fn(&str) -> &str>) {
::std::todo!()
}

fn main() {}
@@ -1,11 +1,8 @@
use std::ops::Deref;
use std::rc::Rc;
#![no_implicit_prelude]

use yew::prelude::*;

#[hook]
fn use_deref_as_u32() -> impl Deref<Target = u32> {
Rc::new(0)
#[::yew::prelude::hook]
fn use_deref_as_u32() -> impl ::std::ops::Deref<Target = ::std::primitive::u32> {
::std::rc::Rc::new(0)
}

fn main() {}
6 changes: 3 additions & 3 deletions packages/yew-macro/tests/hook_attr/hook-return-ref-pass.rs
@@ -1,7 +1,7 @@
use yew::prelude::*;
#![no_implicit_prelude]

#[hook]
fn use_str_ref(f: &str) -> &str {
#[::yew::prelude::hook]
fn use_str_ref(f: &::std::primitive::str) -> &::std::primitive::str {
f
}

Expand Down

0 comments on commit 4ad2b71

Please sign in to comment.