Accept ToString instead of AsRef<str> in Params.set() (#3732)

This commit is contained in:
link2xt
2022-11-05 04:17:29 +03:00
committed by GitHub
parent 1a745b24d7
commit cb1a4291d0
2 changed files with 3 additions and 3 deletions

View File

@@ -726,7 +726,7 @@ impl Message {
self.text = text;
}
pub fn set_file(&mut self, file: impl AsRef<str>, filemime: Option<&str>) {
pub fn set_file(&mut self, file: impl ToString, filemime: Option<&str>) {
self.param.set(Param::File, file);
if let Some(filemime) = filemime {
self.param.set(Param::MimeType, filemime);

View File

@@ -266,8 +266,8 @@ impl Params {
}
/// Set the given key to the passed in value.
pub fn set(&mut self, key: Param, value: impl AsRef<str>) -> &mut Self {
self.inner.insert(key, value.as_ref().to_string());
pub fn set(&mut self, key: Param, value: impl ToString) -> &mut Self {
self.inner.insert(key, value.to_string());
self
}