-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some suggestion #4
Comments
use std::marker::PhantomData;
#[derive(new)]
struct Generic<'a, T: Default, P> {
x: &'a str,
y: PhantomData<P>,
#[new(default)]
z: T,
}
let _ = Generic::<i32, u8>::new("Hello"); If you have suggestion to replace Rayon and Crossbeam on the list or better description to derive_new please send a Pull Request! |
1 is fixed! |
For 2. I meant someone might though #[derive(new)]
struct Foo {
#[new(value = "default")]
value: String,
}
Foo::new();
Foo::new("bar"); would work, since python supports optional argument. It's not a big problem at all, just a small suggestion. |
Aren't Crossbeam and Rayon libraries about threads? They doesn't seem to match the description "Run external commands".
The python code of
derive_new
crate__init__(self, value='default')
kind of suggest that rust has optional parameters, which rust does not.The text was updated successfully, but these errors were encountered: