diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-01-14 20:18:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-14 23:18:58 -0500 |
commit | d5634164cb86771fc279468cbb93e311c1ad3089 (patch) | |
tree | 2878a536acdb5106e48488e640cd78dfa2b5893a /core | |
parent | efcbfd5206fcdfac55c26a7133c04dd330d047b9 (diff) |
chore: use rustfmt imports_granularity option (#17421)
Closes https://github.com/denoland/deno/issues/2699
Closes https://github.com/denoland/deno/issues/2347
Uses unstable rustfmt features. Since dprint invokes `rustfmt` we do not
need to switch the cargo toolchain to nightly. Do we care about
formatting stability of our codebase across Rust versions? (I don't)
Diffstat (limited to 'core')
-rw-r--r-- | core/extensions.rs | 4 | ||||
-rw-r--r-- | core/modules.rs | 3 | ||||
-rw-r--r-- | core/ops_builtin.rs | 4 | ||||
-rw-r--r-- | core/ops_metrics.rs | 3 | ||||
-rw-r--r-- | core/runtime.rs | 3 |
5 files changed, 12 insertions, 5 deletions
diff --git a/core/extensions.rs b/core/extensions.rs index 437621c0e..2cb16b125 100644 --- a/core/extensions.rs +++ b/core/extensions.rs @@ -1,7 +1,9 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. use crate::OpState; use anyhow::Error; -use std::{cell::RefCell, rc::Rc, task::Context}; +use std::cell::RefCell; +use std::rc::Rc; +use std::task::Context; use v8::fast_api::FastFunction; pub type SourcePair = (&'static str, &'static str); diff --git a/core/modules.rs b/core/modules.rs index 917649c85..8a79143f0 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -1190,7 +1190,8 @@ mod tests { use std::future::Future; use std::io; use std::path::PathBuf; - use std::sync::atomic::{AtomicUsize, Ordering}; + use std::sync::atomic::AtomicUsize; + use std::sync::atomic::Ordering; use std::sync::Arc; // deno_ops macros generate code assuming deno_core in scope. mod deno_core { diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs index 905496025..184e942b7 100644 --- a/core/ops_builtin.rs +++ b/core/ops_builtin.rs @@ -13,7 +13,9 @@ use crate::ZeroCopyBuf; use anyhow::Error; use deno_ops::op; use std::cell::RefCell; -use std::io::{stderr, stdout, Write}; +use std::io::stderr; +use std::io::stdout; +use std::io::Write; use std::rc::Rc; pub(crate) fn init_builtins() -> Extension { diff --git a/core/ops_metrics.rs b/core/ops_metrics.rs index 7daeaab19..c0b8abb51 100644 --- a/core/ops_metrics.rs +++ b/core/ops_metrics.rs @@ -2,7 +2,8 @@ use crate::serde::Serialize; use crate::OpId; -use std::cell::{RefCell, RefMut}; +use std::cell::RefCell; +use std::cell::RefMut; // TODO(@AaronO): split into AggregateMetrics & PerOpMetrics #[derive(Clone, Default, Debug, Serialize)] diff --git a/core/runtime.rs b/core/runtime.rs index 0a5404fa1..2f818c7f8 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -2593,7 +2593,8 @@ pub mod tests { use std::ops::FnOnce; use std::pin::Pin; use std::rc::Rc; - use std::sync::atomic::{AtomicUsize, Ordering}; + use std::sync::atomic::AtomicUsize; + use std::sync::atomic::Ordering; use std::sync::Arc; // deno_ops macros generate code assuming deno_core in scope. mod deno_core { |