Skip to content

Commit

Permalink
Update to Linebender lint set v2. (#21)
Browse files Browse the repository at this point in the history
No code changes were required.
  • Loading branch information
xStrom authored Nov 27, 2024
1 parent 04c34ce commit 0c7eaab
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LINEBENDER LINT SET - .clippy.toml - v1
# See https://linebender.org/wiki/canonical-lints/

# The default Clippy value is capped at 8 bytes, which was chosen to improve performance on 32-bit.
# Given that we are building for the future and even low-end mobile phones have 64-bit CPUs,
# it makes sense to optimize for 64-bit and accept the performance hits on 32-bit.
# 16 bytes is the number of bytes that fits into two 64-bit CPU registers.
trivial-copy-size-limit = 16

# END LINEBENDER LINT SET
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ version = "0.1.1"
# Unsafe is used in android_trace for FFI.
rust.unsafe_code = "deny"

# LINEBENDER LINT SET - v1
# LINEBENDER LINT SET - Cargo.toml - v2
# See https://linebender.org/wiki/canonical-lints/
rust.keyword_idents_2024 = "forbid"
rust.non_ascii_idents = "forbid"
Expand Down Expand Up @@ -70,6 +70,7 @@ clippy.semicolon_if_nothing_returned = "warn"
clippy.shadow_unrelated = "warn"
clippy.should_panic_without_expect = "warn"
clippy.todo = "warn"
clippy.trivially_copy_pass_by_ref = "warn"
clippy.unseparated_literal_suffix = "warn"
clippy.use_self = "warn"
clippy.wildcard_imports = "warn"
Expand Down
13 changes: 7 additions & 6 deletions android_trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
//! .rustdoc-hidden { display: none; }
//! </style>
#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![allow(
unsafe_code,
// reason = "This crate does FFI, and so must be able to use unsafe"
)]
// LINEBENDER LINT SET - v1
// LINEBENDER LINT SET - lib.rs - v1
// See https://linebender.org/wiki/canonical-lints/
// These lints aren't included in Cargo.toml because they
// shouldn't apply to examples and tests
#![warn(unused_crate_dependencies)]
#![warn(clippy::print_stdout, clippy::print_stderr)]
// END LINEBENDER LINT SET
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![allow(
unsafe_code,
// reason = "This crate does FFI, and so must be able to use unsafe"
)]

#[cfg(not(feature = "api_level_23"))]
use ffi::ATraceAPILevel23Methods;
Expand Down
7 changes: 4 additions & 3 deletions tracing_android_trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
//! .rustdoc-hidden { display: none; }
//! </style>
#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
// LINEBENDER LINT SET - v1
// LINEBENDER LINT SET - lib.rs - v1
// See https://linebender.org/wiki/canonical-lints/
// These lints aren't included in Cargo.toml because they
// shouldn't apply to examples and tests
#![warn(unused_crate_dependencies)]
#![warn(clippy::print_stdout, clippy::print_stderr)]
// END LINEBENDER LINT SET
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]

#[cfg(not(target_os = "android"))]
compile_error!(
Expand Down

0 comments on commit 0c7eaab

Please sign in to comment.