-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add a default
and value
attribute parameters
#102
Comments
@ffuugoo @tyranron This is needed to make #[derive(From, Error, Display)]
struct SimpleError;
#[derive(From, Error, Display)]
#[display(fmt="Some error")]
struct BacktraceError {
source: SimpleError,
#[from(value=::std::backtrace::capture())]
backtrace: Backtrace,
}
fn simple_failing_function() -> Result<(), SimpleError> {
Err(SimpleError)
}
fn backtrace_failing_function() -> Result<(), BacktraceError> {
simple_failing_function()?
} |
Possibly we would want this case to have a special syntax for usability, e.g. |
@JelteF I'm agree with having But regarding the syntax Also, it worth considering the syntax in #[default = "localhost"]
host: Cow<'static, str>, |
This is a good idea, so how is the progress now? |
Removing this from the 1.0 milestone, since it doesn't require breaking changes. |
Maybe it would also be nice to be able to define |
This would allow the same flexibility that's provided by
derive_new
forFrom
,TryFrom
,FromStr
andConstructor
. It would also be nice to addnew
as a derive as well, soderive_more
can be a drop-in replacement forderive_new
.The text was updated successfully, but these errors were encountered: