mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-11 12:31:14 +01:00
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:
commit
9e62bfee95
4 changed files with 4 additions and 8 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue