presence: Simplify Presence::set_status with Into<String>.

This commit is contained in:
Emmanuel Gil Peyrot 2019-02-26 19:51:41 +01:00
parent dd80f55c5f
commit ab28824b1a

View file

@ -245,8 +245,11 @@ impl Presence {
} }
/// Set the availability information of this presence. /// Set the availability information of this presence.
pub fn set_status(&mut self, lang: Lang, status: Status) { pub fn set_status<L, S>(&mut self, lang: L, status: S)
self.statuses.insert(lang, status); where L: Into<Lang>,
S: Into<Status>,
{
self.statuses.insert(lang.into(), status.into());
} }
/// Add a payload to this presence. /// Add a payload to this presence.