Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dyn to areas of core. #2538

Merged
merged 2 commits into from
Jun 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I'm not sure what was happening on the other branch - I had to make that change to get it to compile locally... but if this is passing CI, I think it would be better left as is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to &line in the other branch and you pushed a commit to line.clone().

line
}).map_err(|e| deno_error(ErrorKind::Other, e.description().to_string()))
// Forward error to TS side for processing
Expand Down
4 changes: 2 additions & 2 deletions core/isolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ pub enum StartupData<'a> {

pub type OpResult<E> = Result<Op<E>, E>;

type CoreDispatchFn = Fn(&[u8], Option<PinnedBuf>) -> CoreOp;
type CoreDispatchFn = dyn Fn(&[u8], Option<PinnedBuf>) -> CoreOp;

pub type DynImportFuture = Box<dyn Future<Item = deno_mod, Error = ()> + 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.
Expand Down
2 changes: 1 addition & 1 deletion core/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ mod tests {
}

impl Error for MockError {
fn cause(&self) -> Option<&Error> {
fn cause(&self) -> Option<&dyn Error> {
unimplemented!()
}
}
Expand Down