mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* Fix Call Generics & FnOnce macro hygiene. * Add a failure case as well. * Remove a unused struct in test case. * Update packages/yew-macro/tests/hook_attr/hook-const-generic-pass.rs Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com>
31 lines
704 B
Rust
31 lines
704 B
Rust
#![no_implicit_prelude]
|
|
|
|
#[derive(
|
|
::std::prelude::rust_2021::Debug,
|
|
::std::prelude::rust_2021::PartialEq,
|
|
::std::prelude::rust_2021::Clone,
|
|
)]
|
|
struct Ctx;
|
|
|
|
#[::yew::prelude::hook]
|
|
fn use_some_html() -> ::yew::prelude::Html {
|
|
::yew::prelude::use_context::<Ctx>().unwrap();
|
|
|
|
if let ::std::prelude::rust_2021::Some(_m) = ::yew::prelude::use_context::<Ctx>() {
|
|
::std::todo!()
|
|
}
|
|
|
|
let _ctx = { ::yew::prelude::use_context::<Ctx>() };
|
|
|
|
match ::yew::prelude::use_context::<Ctx>() {
|
|
::std::prelude::rust_2021::Some(_) => {
|
|
::std::todo!()
|
|
}
|
|
::std::prelude::rust_2021::None => {
|
|
::std::todo!()
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|