1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 04:56:12 +03:00

remove cfg_attr(feature = "cargo-clippy" noise

I never liked clippy for dropping turds like this throughout the
code. I'm glad it is no longer required, but now rust is warning
about this syntax being redundant.
This commit is contained in:
Wez Furlong 2024-09-14 06:49:13 -07:00
parent 45ec2464e5
commit c0649ad4bb
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
14 changed files with 16 additions and 25 deletions

View File

@ -9,7 +9,7 @@
//! of this code; in this way the client and server can more gracefully //! of this code; in this way the client and server can more gracefully
//! manage unknown enum variants. //! manage unknown enum variants.
#![allow(dead_code)] #![allow(dead_code)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::range_plus_one))] #![allow(clippy::range_plus_one)]
use anyhow::{bail, Context as _, Error}; use anyhow::{bail, Context as _, Error};
use config::keyassignment::{PaneDirection, ScrollbackEraseMode}; use config::keyassignment::{PaneDirection, ScrollbackEraseMode};

View File

@ -581,7 +581,7 @@ impl TextStyle {
} }
} }
#[cfg_attr(feature = "cargo-clippy", allow(clippy::let_and_return))] #[allow(clippy::let_and_return)]
pub fn font_with_fallback(&self) -> Vec<FontAttributes> { pub fn font_with_fallback(&self) -> Vec<FontAttributes> {
let mut font = self.font.clone(); let mut font = self.font.clone();

View File

@ -32,7 +32,7 @@ fn openpty(size: PtySize) -> anyhow::Result<(UnixMasterPty, UnixSlavePty)> {
let result = unsafe { let result = unsafe {
// BSDish systems may require mut pointers to some args // BSDish systems may require mut pointers to some args
#[cfg_attr(feature = "cargo-clippy", allow(clippy::unnecessary_mut_passed))] #[allow(clippy::unnecessary_mut_passed)]
libc::openpty( libc::openpty(
&mut master, &mut master,
&mut slave, &mut slave,
@ -262,7 +262,7 @@ impl PtyFd {
// type::from(), but the size and potentially signedness // type::from(), but the size and potentially signedness
// are system dependent, which is why we're using `as _`. // are system dependent, which is why we're using `as _`.
// Suppress this lint for this section of code. // Suppress this lint for this section of code.
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_lossless))] #[allow(clippy::cast_lossless)]
if controlling_tty { if controlling_tty {
// Set the pty as the controlling terminal. // Set the pty as the controlling terminal.
// Failure to do this means that delivery of // Failure to do this means that delivery of

View File

@ -1,8 +1,5 @@
// clippy hates bitflags // clippy hates bitflags
#![cfg_attr( #![allow(clippy::suspicious_arithmetic_impl, clippy::redundant_field_names)]
feature = "cargo-clippy",
allow(clippy::suspicious_arithmetic_impl, clippy::redundant_field_names)
)]
use super::VisibleRowIndex; use super::VisibleRowIndex;
#[cfg(feature = "use_serde")] #[cfg(feature = "use_serde")]

View File

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

View File

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

View File

@ -1,6 +1,6 @@
//! Colors for attributes //! Colors for attributes
// for FromPrimitive // for FromPrimitive
#![cfg_attr(feature = "cargo-clippy", allow(clippy::useless_attribute))] #![allow(clippy::useless_attribute)]
use num_derive::*; use num_derive::*;
#[cfg(feature = "use_serde")] #[cfg(feature = "use_serde")]

View File

@ -1,6 +1,6 @@
// suppress inscrutable useless_attribute clippy that shows up when // suppress inscrutable useless_attribute clippy that shows up when
// using derive(FromPrimitive) // using derive(FromPrimitive)
#![cfg_attr(feature = "cargo-clippy", allow(clippy::useless_attribute))] #![allow(clippy::useless_attribute)]
#![allow(clippy::upper_case_acronyms)] #![allow(clippy::upper_case_acronyms)]
//! This module provides the ability to parse escape sequences and attach //! This module provides the ability to parse escape sequences and attach
//! semantic meaning to them. It can also encode the semantic values as //! semantic meaning to them. It can also encode the semantic values as

View File

@ -1085,10 +1085,7 @@ impl ITermDimension {
} }
impl ITermProprietary { impl ITermProprietary {
#[cfg_attr( #[allow(clippy::cyclomatic_complexity, clippy::cognitive_complexity)]
feature = "cargo-clippy",
allow(clippy::cyclomatic_complexity, clippy::cognitive_complexity)
)]
fn parse(osc: &[&[u8]]) -> Result<Self> { fn parse(osc: &[&[u8]]) -> Result<Self> {
// iTerm has a number of different styles of OSC parameter // iTerm has a number of different styles of OSC parameter
// encodings, which makes this section of code a bit gnarly. // encodings, which makes this section of code a bit gnarly.

View File

@ -30,7 +30,7 @@ where
} }
#[cfg(feature = "use_serde")] #[cfg(feature = "use_serde")]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::trivially_copy_pass_by_ref))] #[allow(clippy::trivially_copy_pass_by_ref)]
fn serialize_notnan<S>(value: &NotNan<f32>, serializer: S) -> Result<S::Ok, S::Error> fn serialize_notnan<S>(value: &NotNan<f32>, serializer: S) -> Result<S::Ok, S::Error>
where where
S: Serializer, S: Serializer,

View File

@ -48,7 +48,7 @@ impl TerminfoRenderer {
}); });
} }
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cognitive_complexity))] #[allow(clippy::cognitive_complexity)]
fn flush_pending_attr<W: RenderTty + Write>(&mut self, out: &mut W) -> Result<()> { fn flush_pending_attr<W: RenderTty + Write>(&mut self, out: &mut W) -> Result<()> {
macro_rules! attr_on { macro_rules! attr_on {
($cap:ident, $sgr:expr) => {{ ($cap:ident, $sgr:expr) => {{
@ -330,10 +330,7 @@ impl TerminfoRenderer {
Ok(()) Ok(())
} }
#[cfg_attr( #[allow(clippy::cyclomatic_complexity, clippy::cognitive_complexity)]
feature = "cargo-clippy",
allow(clippy::cyclomatic_complexity, clippy::cognitive_complexity)
)]
pub fn render_to<W: RenderTty + Write>( pub fn render_to<W: RenderTty + Write>(
&mut self, &mut self,
changes: &[Change], changes: &[Change],

View File

@ -400,7 +400,7 @@ impl<'widget> Ui<'widget> {
let mut changed = false; let mut changed = false;
// Clippy is dead wrong about this iterator being an identity_conversion // Clippy is dead wrong about this iterator being an identity_conversion
#[cfg_attr(feature = "cargo-clippy", allow(clippy::identity_conversion))] #[allow(clippy::identity_conversion)]
for result in layout.compute_constraints(width, height, root)? { for result in layout.compute_constraints(width, height, root)? {
let render_data = self.render.get_mut(&result.widget).unwrap(); let render_data = self.render.get_mut(&result.widget).unwrap();
let coords = ParentRelativeCoords::new(result.rect.x, result.rect.y); let coords = ParentRelativeCoords::new(result.rect.x, result.rect.y);

View File

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

View File

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