From ed390a51cac08ec238b45c793a5ddd65fcae1b78 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 18 Jun 2019 23:28:56 +1000 Subject: Add dyn to be rust nightly compatible (#2538) --- cli/repl.rs | 2 +- core/isolate.rs | 4 ++-- core/modules.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/repl.rs b/cli/repl.rs index 55bf4a114..86fa92e08 100644 --- a/cli/repl.rs +++ b/cli/repl.rs @@ -94,7 +94,7 @@ impl Repl { .editor .readline(&prompt) .map(|line| { - self.editor.add_history_entry(line.as_ref()); + self.editor.add_history_entry(line.clone()); line }).map_err(|e| deno_error(ErrorKind::Other, e.description().to_string())) // Forward error to TS side for processing diff --git a/core/isolate.rs b/core/isolate.rs index 1ba86d727..cdb505342 100644 --- a/core/isolate.rs +++ b/core/isolate.rs @@ -76,10 +76,10 @@ pub enum StartupData<'a> { pub type OpResult = Result, E>; -type CoreDispatchFn = Fn(&[u8], Option) -> CoreOp; +type CoreDispatchFn = dyn Fn(&[u8], Option) -> CoreOp; pub type DynImportFuture = Box + Send>; -type DynImportFn = Fn(&str, &str) -> DynImportFuture; +type DynImportFn = dyn Fn(&str, &str) -> DynImportFuture; /// Wraps DynImportFuture to include the deno_dyn_import_id, so that it doesn't /// need to be exposed. diff --git a/core/modules.rs b/core/modules.rs index 5a0e33798..a8252bea5 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -597,7 +597,7 @@ mod tests { } impl Error for MockError { - fn cause(&self) -> Option<&Error> { + fn cause(&self) -> Option<&dyn Error> { unimplemented!() } } -- cgit v1.2.3