chore: use rustfmt imports_granularity option#17421
chore: use rustfmt imports_granularity option#17421littledivy merged 2 commits intodenoland:mainfrom
Conversation
| use std::io::{self, Error, Write}; | ||
| use std::io::Error; | ||
| use std::io::Write; | ||
| use std::io::{self}; |
There was a problem hiding this comment.
| use std::io::{self}; | |
| use std::io; |
Maybe this should be reported to rustfmt 👀
There was a problem hiding this comment.
Note that
use crate::lexer;anduse crate::lexer::{self};are not actually equivalent: The latter only imports the lexer module, while the former looks in all namespaces, so it can import up to 3 items at once, e.g. a function, a module and a macro of the same name.
There was a problem hiding this comment.
I think just use std::io; works in this case though?
There was a problem hiding this comment.
I missed that this was auto merging, but we can “fix” these as we see them in the future.
| use std::pin::Pin; | ||
| use std::task::{self, Poll}; | ||
| use std::task::Poll; | ||
| use std::task::{self}; |
core/lib.rs
Outdated
| pub use serde_v8::StringOrBuffer; | ||
| pub use serde_v8::U16String; | ||
| pub use serde_v8::ZeroCopyBuf; | ||
| pub use serde_v8::{self}; |
There was a problem hiding this comment.
hmmm.. this looks really unnatural. I wonder if there's a way to avoid {self}
| use serde::de::{self, SeqAccess as _, Visitor}; | ||
| use serde::de::SeqAccess as _; | ||
| use serde::de::Visitor; | ||
| use serde::de::{self}; |
| // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. | ||
| use std::fmt::{self, Display}; | ||
| use std::fmt::Display; | ||
| use std::fmt::{self}; |
.dprint.json
Outdated
| "exec": { | ||
| "associations": "**/*.rs", | ||
| "rustfmt": "rustfmt" | ||
| "rustfmt": "rustfmt --config imports_granularity=item,wrap_comments=true" |
|
@dsherret Removed |
dsherret
left a comment
There was a problem hiding this comment.
LGTM with just imports_granularity.
Closes denoland#2699 Closes denoland#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)
Closes #2699
Closes #2347
Uses unstable rustfmt features. Since dprint invokes
rustfmtwe 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)