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

Emmanuel Gil Peyrot created

Change summary

src/presence.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Detailed changes

src/presence.rs 🔗

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