Merge pull request #92 from teloxide/resolve-has-payload-fixme

Resolve FIXME in `HasPayload`: we've decided to not add `As{Mut,Ref}` bounds
This commit is contained in:
Hirrolot 2021-06-19 15:14:25 +06:00 committed by GitHub
commit 9e62bfee95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 8 deletions

View file

@ -17,11 +17,7 @@ use crate::requests::Payload;
/// [`BorrowMut`]: std::borrow::BorrowMut
/// [`Payload`]: crate::requests::Payload
/// [output type]: HasPayload::Payload
pub trait HasPayload
// FIXME(waffle):
// we wanted to use As{Mut,Ref} here, but they doesn't work
// because of https://github.com/rust-lang/rust/issues/77010
{
pub trait HasPayload {
/// The type of the payload contained.
type Payload: Payload;

View file

@ -80,7 +80,7 @@ mod tests {
}),
file_name: None,
};
let actual = serde_json::from_str::<Audio>(&json).unwrap();
let actual = serde_json::from_str::<Audio>(json).unwrap();
assert_eq!(actual, expected)
}
}

View file

@ -625,7 +625,7 @@ mod tests {
can_promote_members: true,
}),
};
let actual = serde_json::from_str::<ChatMember>(&json).unwrap();
let actual = serde_json::from_str::<ChatMember>(json).unwrap();
assert_eq!(actual, expected)
}
}

View file

@ -66,7 +66,7 @@ mod tests {
username: Some("Username".to_string()),
language_code: Some(String::from("ru")),
};
let actual = serde_json::from_str::<User>(&json).unwrap();
let actual = serde_json::from_str::<User>(json).unwrap();
assert_eq!(actual, expected)
}
}