style: apply nightly rustfmt import grouping across the workspace

rustfmt.toml sets group_imports, imports_granularity and imports_layout,
which are nightly-only; agents formatted with stable rustfmt, which
ignored them. This is a formatting-only pass with `cargo +nightly fmt`.

Test Plan:
- cargo clippy --workspace --all-targets -- -D warnings
- cargo test --workspace
This commit is contained in:
ddidderr committed 2026-10-12 05:03:37 +02:00
1 parent 81d4119d85
commit 8bcb85a29a
259 files changed
+2495 -1547

No files matched your search

+4 -2
View File
@@ -2,8 +2,10 @@
//! into a stream. The hook/put/unhook functions are meant to be called from
//! the stream's dcsHook, dcsPut, and dcsUnhook functions, respectively.
use crate::parser::Dcs;
use crate::tmux::control::{Notification, Parser as TmuxParser};
use crate::{
parser::Dcs,
tmux::control::{Notification, Parser as TmuxParser},
};
/// DCS command handler.
#[derive(Debug)]
+2 -2
View File
@@ -1,9 +1,9 @@
//! Kitty color protocol (ZIG/src/terminal/kitty/color.zig).
use crate::color::Rgb;
use crate::osc::Terminator;
use std::fmt;
use crate::{color::Rgb, osc::Terminator};
/// OSC 21 payload.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OSC {
@@ -69,8 +69,10 @@ fn parse_int(buf: &[u8], signed: bool) -> Result<u32, Error> {
/// Decode base64 payload data. The reference implementation uses simdutf,
/// which ignores ASCII whitespace and tolerates missing padding.
pub fn decode_base64(input: &[u8]) -> Result<Vec<u8>, Error> {
use base64::Engine;
use base64::engine::{DecodePaddingMode, GeneralPurpose, GeneralPurposeConfig};
use base64::{
Engine,
engine::{DecodePaddingMode, GeneralPurpose, GeneralPurposeConfig},
};
const ENGINE: GeneralPurpose = GeneralPurpose::new(
&base64::alphabet::STANDARD,
GeneralPurposeConfig::new()
+1 -2
View File
@@ -18,8 +18,7 @@
pub mod encoding;
pub mod parsers;
pub use parsers::color;
pub use parsers::semantic_prompt;
pub use parsers::{color, semantic_prompt};
use crate::kitty::color as kitty_color;
+4 -2
View File
@@ -1,8 +1,10 @@
//! OSC color operations: 4, 5, 10-19, 104, 105, 110-119
//! (ZIG/src/terminal/osc/parsers/color.zig).
use crate::color::{Dynamic as DynamicColor, Rgb, Special as SpecialColor};
use crate::osc::{Command, Parser, State, Terminator};
use crate::{
color::{Dynamic as DynamicColor, Rgb, Special as SpecialColor},
osc::{Command, Parser, State, Terminator},
};
/// The possible operations we support for colors.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
@@ -1,8 +1,10 @@
//! OSC 21, the Kitty Color Protocol (ZIG/src/terminal/osc/parsers/kitty_color.zig).
use crate::color::Rgb;
use crate::kitty::color::{Kind, OSC, Request};
use crate::osc::{Command, Parser, State, Terminator};
use crate::{
color::Rgb,
kitty::color::{Kind, OSC, Request},
osc::{Command, Parser, State, Terminator},
};
/// Parse OSC 21, the Kitty Color Protocol.
pub fn parse(parser: &mut Parser, terminator_ch: Option<u8>) -> Option<Command> {
@@ -3,8 +3,10 @@
//!
//! <https://gitlab.freedesktop.org/Per_Bothner/specifications/blob/master/proposals/semantic-prompts.md>
use crate::osc::{Command as OscCommand, Parser, State};
use crate::string_encoding::{printf_q_decode, url_percent_decode};
use crate::{
osc::{Command as OscCommand, Parser, State},
string_encoding::{printf_q_decode, url_percent_decode},
};
/// Error returned when decoding a command line fails (Zig
/// `error.DecodeError`).
+1 -2
View File
@@ -13,8 +13,7 @@
//! through `params()` / `intermediates()` accessors, so an `Action` owns its
//! data and is independent of the parser's lifetime.
use crate::osc;
use crate::parse_table::TABLE;
use crate::{osc, parse_table::TABLE};
/// Maximum number of CSI parameters. This is a const in Ghostty so we
/// match it.
+6 -3
View File
@@ -4,8 +4,10 @@
//! C-ABI helpers of the Zig version (`Attribute.C`, `cval`, `lib.Enum`
//! `Tag`) are intentionally not ported.
use crate::color::{Name, Rgb};
use crate::parser::{MAX_PARAMS, SepList};
use crate::{
color::{Name, Rgb},
parser::{MAX_PARAMS, SepList},
};
/// Attribute type for SGR
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -413,9 +415,10 @@ impl<'a> Iterator for Parser<'a> {
mod tests {
#![allow(clippy::unwrap_used)]
use super::*;
use Attribute as A;
use super::*;
fn rgb(r: u8, g: u8, b: u8) -> Rgb {
Rgb { r, g, b }
}
+16 -13
View File
@@ -18,18 +18,20 @@
#![allow(clippy::single_match_else, clippy::if_not_else)]
use crate::ansi;
use crate::charsets;
use crate::csi;
use crate::device_status;
use crate::kitty;
use crate::modes;
use crate::mouse_shape::MouseShape;
use crate::osc;
use crate::parser::{self, Csi, Esc, MAX_PARAMS, Parser, State};
use crate::sgr;
use crate::simd;
use crate::utf8_decoder::Utf8Decoder;
use crate::{
ansi,
charsets,
csi,
device_status,
kitty,
modes,
mouse_shape::MouseShape,
osc,
parser::{self, Csi, Esc, MAX_PARAMS, Parser, State},
sgr,
simd,
utf8_decoder::Utf8Decoder,
};
macro_rules! define_actions {
($( $(#[$meta:meta])* $name:ident $( ( $ty:ty ) )? ),* $(,)?) => {
@@ -1658,9 +1660,10 @@ impl<H: Handler> Stream<H> {
#[cfg(test)]
mod tests {
#![allow(clippy::unwrap_used)]
use super::*;
use std::convert::Infallible;
use super::*;
/// Test handler that forwards every action to a closure.
struct F<T, C: FnMut(&mut T, Action<'_>)> {
state: T,
+2 -2
View File
@@ -1,8 +1,8 @@
//! X11 color names (ZIG/src/terminal/x11_color.zig).
use std::{collections::HashMap, sync::OnceLock};
use crate::color::Rgb;
use std::collections::HashMap;
use std::sync::OnceLock;
/// This is the rgb.txt file from the X11 project. This was last sourced
/// from this location: https://gitlab.freedesktop.org/xorg/app/rgb