chore: small tweak to the serde CommandArg impl for cargo 1.61.0-nightly

The nightly version 1.61.0 of Cargo is failing to generate JSON documentation for this implementation, so we're helping it a little bit by changing `Self` to `D` since that's where their assert is failing
This commit is contained in:
Lucas Nogueira 2022-03-06 20:34:19 -03:00
parent 34090bab8f
commit 66fe5d81bc
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1

View File

@ -49,7 +49,7 @@ pub trait CommandArg<'de, R: Runtime>: Sized {
/// Automatically implement [`CommandArg`] for any type that can be deserialized.
impl<'de, D: Deserialize<'de>, R: Runtime> CommandArg<'de, R> for D {
fn from_command(command: CommandItem<'de, R>) -> Result<Self, InvokeError> {
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError> {
let name = command.name;
let arg = command.key;
Self::deserialize(command).map_err(|e| crate::Error::InvalidArgs(name, arg, e).into())