diff --git a/src/message.rs b/src/message.rs index 3da05a34c..d9e2a2558 100644 --- a/src/message.rs +++ b/src/message.rs @@ -726,7 +726,7 @@ impl Message { self.text = text; } - pub fn set_file(&mut self, file: impl AsRef, 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); diff --git a/src/param.rs b/src/param.rs index cd791d502..981a1f0dd 100644 --- a/src/param.rs +++ b/src/param.rs @@ -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) -> &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 }