style: Add newline after inner attribute for readability (#8130)

Add a newline after inner attributes to make it clear that the
attribute applies to the enclosing item rather than the following item.
This commit is contained in:
xtqqczze 2026-09-05 14:31:29 +01:00 committed by GitHub
parent e019f1b11e
commit 092dcf70d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 44 additions and 12 deletions

View File

@ -1,4 +1,5 @@
#![no_std]
use alloc::borrow::Cow;
use core::ops::Range;
use level::MAX_DEPTH;

View File

@ -8,6 +8,7 @@
//! client and server instances that are built from different versions
//! of this code; in this way the client and server can more gracefully
//! manage unknown enum variants.
#![allow(dead_code)]
#![allow(clippy::range_plus_one)]

View File

@ -19,8 +19,10 @@ bindgen bindings.h -o src/lib.rs \
--raw-line "#![allow(non_upper_case_globals)]" \
--raw-line "#![allow(clippy::unreadable_literal)]" \
--raw-line "#![allow(clippy::upper_case_acronyms)]" \
--raw-line "mod types;" \
--raw-line "" \
--raw-line "mod fixed_point;" \
--raw-line "mod types;" \
--raw-line "" \
--raw-line "pub use fixed_point::*;" \
--raw-line "pub type FT_Int16 = i16;" \
--raw-line "pub type FT_UInt16 = u16;" \

View File

@ -5,8 +5,10 @@
#![allow(non_upper_case_globals)]
#![allow(clippy::unreadable_literal)]
#![allow(clippy::upper_case_acronyms)]
mod fixed_point;
mod types;
pub use fixed_point::*;
pub type FT_Int16 = i16;
pub type FT_UInt16 = u16;

View File

@ -1,4 +1,5 @@
#![cfg(target_os = "linux")]
use super::*;
impl From<&str> for LocalProcessStatus {

View File

@ -1,4 +1,5 @@
#![cfg(target_os = "macos")]
use super::*;
use std::ffi::{OsStr, OsString};
use std::os::unix::ffi::{OsStrExt, OsStringExt};

View File

@ -1,4 +1,5 @@
#![cfg(windows)]
use super::*;
use ntapi::ntpebteb::PEB;
use ntapi::ntpsapi::{

View File

@ -1,4 +1,5 @@
#![allow(clippy::range_plus_one)]
use super::*;
use crate::config::BidiMode;
use log::debug;

View File

@ -1,6 +1,7 @@
// The range_plus_one lint can't see when the LHS is not compatible with
// and inclusive range
#![allow(clippy::range_plus_one)]
use super::*;
use crate::color::{ColorPalette, RgbColor};
use crate::config::{BidiMode, NewlineCanon};

View File

@ -1,6 +1,8 @@
//! This example shows how to make a basic widget that accumulates
//! text input and renders it to the screen
#![allow(unused)]
use termwiz::caps::Capabilities;
use termwiz::cell::AttributeChange;
use termwiz::color::{AnsiColor, ColorAttribute};

View File

@ -1,6 +1,3 @@
// Ideally this would be scoped to WidgetId, but I can't seem to find the
// right place for it to take effect
#![allow(clippy::new_without_default)]
use crate::color::ColorAttribute;
use crate::input::InputEvent;
use crate::surface::{Change, CursorShape, CursorVisibility, Position, SequenceNo, Surface};

View File

@ -10,8 +10,10 @@
//! You may wish to use `termwiz::escape::parser::Parser` in the
//! [termwiz](https://docs.rs/termwiz/) crate if you don't want to have to research
//! all those possible escape sequences for yourself.
#![allow(clippy::upper_case_acronyms)]
#![cfg_attr(not(feature = "std"), no_std)]
use utf8parse::Parser as Utf8Parser;
mod enums;
use crate::enums::*;

View File

@ -1,4 +1,5 @@
//! Colors for attributes
// for FromPrimitive
#![allow(clippy::useless_attribute)]

View File

@ -1,5 +1,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
//! Model a cell in the terminal display
#![cfg_attr(not(feature = "std"), no_std)]
use crate::color::{ColorAttribute, PaletteIndex};
#[cfg(feature = "use_image")]
use crate::image::ImageCell;

View File

@ -1,4 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std)]
pub mod emoji;
pub mod emoji_presentation;
pub mod emoji_variation;

View File

@ -3,6 +3,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), macro_use)]
extern crate alloc;
mod array;

View File

@ -1,12 +1,14 @@
//! This module provides the ability to parse escape sequences and attach
//! semantic meaning to them. It can also encode the semantic values as
//! escape sequences. It provides encoding and decoding functionality
//! only; it does not provide terminal emulation facilities itself.
// suppress inscrutable useless_attribute clippy that shows up when
// using derive(FromPrimitive)
#![allow(clippy::useless_attribute)]
#![allow(clippy::upper_case_acronyms)]
#![cfg_attr(not(feature = "std"), no_std)]
//! This module provides the ability to parse escape sequences and attach
//! semantic meaning to them. It can also encode the semantic values as
//! escape sequences. It provides encoding and decoding functionality
//! only; it does not provide terminal emulation facilities itself.
#[cfg(feature = "tmux_cc")]
use crate::tmux_cc::Event;
use core::fmt::{Display, Formatter, Result as FmtResult, Write as FmtWrite};

View File

@ -1,4 +1,5 @@
#![allow(clippy::many_single_char_names)]
#[cfg(feature = "tmux_cc")]
use crate::tmux_cc::Event;
use crate::{

View File

@ -1,4 +1,5 @@
//! Slightly higher level helper for fontconfig
#![allow(clippy::mutex_atomic)]
use anyhow::{anyhow, ensure, Error};

View File

@ -1,6 +1,7 @@
// The range_plus_one lint can't see when the LHS is not compatible with
// and inclusive range
#![allow(clippy::range_plus_one)]
use mux::pane::Pane;
use std::cmp::Ordering;
use std::ops::Range;

View File

@ -1,4 +1,5 @@
#![allow(dead_code)]
use crate::color::LinearRgba;
use crate::customglyph::{BlockKey, Poly};
use crate::glyphcache::CachedGlyph;

View File

@ -1,4 +1,5 @@
#![allow(clippy::range_plus_one)]
use super::renderstate::*;
use super::utilsprites::RenderMetrics;
use crate::colorease::ColorEase;

View File

@ -1,4 +1,5 @@
#![cfg(unix)]
use anyhow::Context;
use libc::pid_t;
use std::io::Write;

View File

@ -1,4 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std)]
use crate::line::CellRef;
use alloc::borrow::Cow;
use core::cmp::min;

View File

@ -1,6 +1,7 @@
#![cfg(all(not(target_os = "macos"), not(windows)))]
//! See <https://developer.gnome.org/notification-spec/>
#![cfg(all(not(target_os = "macos"), not(windows)))]
use crate::ToastNotification;
use futures_util::stream::{abortable, StreamExt};
use serde::{Deserialize, Serialize};

View File

@ -1,4 +1,5 @@
#![cfg(target_os = "macos")]
use crate::ToastNotification;
use block2::{Block, RcBlock};
use objc2::rc::Retained;

View File

@ -1,5 +1,6 @@
#![allow(non_upper_case_globals)]
#![allow(dead_code)]
use std::collections::HashMap;
use wezterm_input_types::PhysKeyCode;

View File

@ -1,4 +1,5 @@
#![allow(unexpected_cfgs)] // <https://github.com/SSheldon/rust-objc/issues/125>
use cocoa::base::{id, nil};
use cocoa::foundation::NSString;
use objc::rc::StrongPtr;

View File

@ -1,4 +1,5 @@
#![cfg(all(unix, not(target_os = "macos")))]
pub mod connection;
pub mod cursor;
pub mod keyboard;

View File

@ -1,4 +1,5 @@
#![allow(non_camel_case_types)]
use libc::c_void;
use xcb::ffi::*;

View File

@ -1,7 +1,7 @@
#![cfg(all(unix, not(target_os = "macos")))]
//! <https://github.com/flatpak/xdg-desktop-portal/blob/main/data/org.freedesktop.portal.Settings.xml>
#![cfg(all(unix, not(target_os = "macos")))]
use crate::{Appearance, Connection, ConnectionOps};
use anyhow::Context;
use futures_lite::future::FutureExt;