mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
Add test
This commit is contained in:
parent
16c7864d63
commit
f8d07237cc
@ -65,7 +65,7 @@ impl ToTokens for PropsBuilder<'_> {
|
|||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#vis struct #builder_name#step_generics
|
#vis struct #builder_name#step_generics
|
||||||
#where_clause
|
#where_clause
|
||||||
{
|
{
|
||||||
wrapped: ::std::boxed::Box<#wrapper_name#ty_generics>,
|
wrapped: ::std::boxed::Box<#wrapper_name#ty_generics>,
|
||||||
_marker: ::std::marker::PhantomData<#step_generic_param>,
|
_marker: ::std::marker::PhantomData<#step_generic_param>,
|
||||||
|
|||||||
@ -83,4 +83,22 @@ mod t5 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod t6 {
|
||||||
|
use super::*;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
#[derive(Properties, Clone)]
|
||||||
|
pub struct Props<T: FromStr + Clone>
|
||||||
|
where
|
||||||
|
<T as FromStr>::Err: Clone,
|
||||||
|
{
|
||||||
|
#[props(required)]
|
||||||
|
value: Result<T, <T as FromStr>::Err>,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn required_prop_generics_with_where_clause_should_work() {
|
||||||
|
Props::<String>::builder().value(Ok(String::from(""))).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user