Ted Driggs

Results 156 comments of Ted Driggs

It's because of [this line](https://github.com/TedDriggs/darling/blob/master/core/src/codegen/field.rs#L183), which governs how `darling` will handle the field if it's missing from the macro input. The `from_none` method allows types to override what value their...

It's possible to hand-construct a `syn::Meta` that has an `Ident` in its `path` field which is a keyword, right? The issue is that attempting to construct it using `Parse` fails?...

I'm leaning towards a solution that uses `#[darling(with="...")]` to choose a parsing function with the desired handling of string literals. I don't want to forbid quotation marks in places where...

@milesj can you try these out for your use-case and make sure they work as-expected? ```rust use syn::{Expr, Meta}; use crate::{Error, FromMeta}; pub fn preserve_str_literal(meta: &Meta) -> crate::Result { match...

@milesj ugh, that's kind of annoying - I don't really want to make people have to create one of these per wrapper type they want (e.g. `Result`, `Option`, `Vec`, etc)....

@greyblake have you tried the `with` approach described above?

A [`proc_macro2::TokenStream`](https://docs.rs/proc-macro2/1.0.66/proc_macro2/struct.TokenStream.html) already impls `Display`, which means it can be wrapped using [`darling::Error::custom`](https://docs.rs/darling/latest/darling/struct.Error.html#method.custom). Alternatively, wouldn't it be possible for `manyhow` to add `impl From for darling::Error` and `impl ToTokensError for...

What would the error message would be in that situation?

I'm not sure how that's different from the current approach, which allows calling `custom` and then setting the span using `with_span`.

Unfortunately, it looks like `darling` can't take this change without bumping the MSRV. Do you know what new MSRV would be required for the new version of `strsim` to build?...