Skip to content

Commit

Permalink
Centralize clippy lints in .cargo/config.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Sep 20, 2023
1 parent b8ddd15 commit f137d71
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 81 deletions.
9 changes: 8 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@
lint = """
clippy --workspace --no-deps -- \
-D warnings \
-A clippy::type_complexity \
-D clippy::semicolon_if_nothing_returned \
-D clippy::trivially-copy-pass-by-ref \
-D clippy::default_trait_access \
-D clippy::match-wildcard-for-single-variants \
-D clippy::redundant-closure-for-method-calls \
-D clippy::filter_map_next \
-D clippy::manual_let_else \
-D clippy::unused_async
-D clippy::unused_async \
-D clippy::from_over_into \
-D clippy::needless_borrow \
-D clippy::new_without_default \
-D clippy::useless_conversion
"""

#![allow(clippy::inherent_to_string, clippy::type_complexity)]

nitpick = """
clippy --workspace --no-deps -- \
-D warnings \
Expand Down
6 changes: 0 additions & 6 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@
missing_debug_implementations,
missing_docs,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
pub mod alignment;
pub mod clipboard;
pub mod event;
Expand Down
6 changes: 0 additions & 6 deletions futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@
missing_debug_implementations,
missing_docs,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub use futures;
pub use iced_core as core;
Expand Down
6 changes: 0 additions & 6 deletions graphics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@
//missing_docs,
unsafe_code,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
mod antialiasing;
mod error;
Expand Down
12 changes: 1 addition & 11 deletions renderer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#![forbid(rust_2018_idioms)]
#![deny(
unsafe_code,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![deny(unsafe_code, unused_results, rustdoc::broken_intra_doc_links)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod compositor;

Expand Down
5 changes: 0 additions & 5 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
missing_debug_implementations,
missing_docs,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
Expand Down
6 changes: 0 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,8 @@
missing_debug_implementations,
missing_docs,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use iced_widget::graphics;
use iced_widget::renderer;
Expand Down
6 changes: 0 additions & 6 deletions style/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@
#![forbid(unsafe_code, rust_2018_idioms)]
#![deny(
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
missing_docs,
unused_results,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
pub use iced_core as core;

pub mod application;
Expand Down
12 changes: 1 addition & 11 deletions tiny_skia/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#![forbid(rust_2018_idioms)]
#![deny(
unsafe_code,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![deny(unsafe_code, unused_results, rustdoc::broken_intra_doc_links)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod window;

Expand Down
6 changes: 0 additions & 6 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@
//missing_docs,
unsafe_code,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod layer;
pub mod primitive;
Expand Down
6 changes: 0 additions & 6 deletions widget/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@
missing_debug_implementations,
missing_docs,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub use iced_renderer as renderer;
pub use iced_renderer::graphics;
Expand Down
11 changes: 6 additions & 5 deletions widget/src/text_input/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ impl Value {
Self { graphemes }
}

/// Converts the [`Value`] into a `String`.
pub fn to_string(&self) -> String {
self.graphemes.concat()
}

/// Inserts a new `char` at the given grapheme `index`.
pub fn insert(&mut self, index: usize, c: char) {
self.graphemes.insert(index, c.to_string());
Expand Down Expand Up @@ -131,3 +126,9 @@ impl Value {
}
}
}

impl std::fmt::Display for Value {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.graphemes.concat())
}
}
6 changes: 0 additions & 6 deletions winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@
missing_debug_implementations,
missing_docs,
unused_results,
clippy::extra_unused_lifetimes,
clippy::from_over_into,
clippy::needless_borrow,
clippy::new_without_default,
clippy::useless_conversion,
unsafe_code,
rustdoc::broken_intra_doc_links
)]
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub use iced_graphics as graphics;
pub use iced_runtime as runtime;
Expand Down

0 comments on commit f137d71

Please sign in to comment.