Less confusing generics

This commit is contained in:
Lucy 2022-03-02 10:18:29 -05:00
parent f7f87104f6
commit 0e9375f058
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
2 changed files with 4 additions and 6 deletions

View file

@ -47,10 +47,9 @@ impl LabeledItem {
.send(LabeledItemMessage::Title(title.to_string())); .send(LabeledItemMessage::Title(title.to_string()));
} }
pub fn set_description<S, O>(&self, description: O) pub fn set_description<'a, O>(&self, description: O)
where where
S: ToString, O: Into<Option<&'a str>>,
O: Into<Option<S>>,
{ {
let description = description.into(); let description = description.into();
self._sender self._sender

View file

@ -45,10 +45,9 @@ impl LabeledItem {
self.inner().model.set_title(title) self.inner().model.set_title(title)
} }
pub fn set_description<S, O>(&self, description: O) pub fn set_description<'a, O>(&self, description: O)
where where
S: ToString, O: Into<Option<&'a str>>,
O: Into<Option<S>>,
{ {
self.inner().model.set_description(description) self.inner().model.set_description(description)
} }