use ToString

This commit is contained in:
Ilya Maximov committed 2022-03-19 02:57:39 +01:00
1 parent 5cbf2698fd
commit b4a5fe9845
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -121,7 +121,7 @@ impl DesktopContext {
}
/// run (evaluate) a script in the WebView context
pub fn eval(&self, script: impl std::fmt::Display) {
pub fn eval(&self, script: impl std::string::ToString) {
let _ = self.proxy.send_event(Eval(script.to_string()));
}
}
@@ -206,7 +206,7 @@ pub(super) fn handler(
/// The closure will cause the message processing thread to panic if the
/// provided script is not valid JavaScript code or if it returns an uncaught
/// error.
pub fn use_eval<S: std::fmt::Display>(cx: &ScopeState) -> impl Fn(S) + '_ {
pub fn use_eval<S: std::string::ToString>(cx: &ScopeState) -> impl Fn(S) + '_ {
let desktop = use_window(&cx);
move |script| desktop.eval(script)