Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ homepage = "https://sentry.io/welcome/"
edition = "2021"
rust-version = "1.88"

[workspace.lints.clippy]
arithmetic-side-effects.level = "warn"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] }
2 changes: 1 addition & 1 deletion sentry-contexts/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ mod model_support {

pub fn get_macos_version() -> Option<String> {
let version = sysctlbyname_call("kern.osproductversion")?;
let dot_count = version.split('.').count() - 1;
let dot_count = version.split('.').count().saturating_sub(1);
if dot_count < 2 {
return Some(version + ".0");
}
Expand Down
4 changes: 2 additions & 2 deletions sentry-core/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ macro_rules! logger_log {
"sentry.message.template".to_owned(),
$crate::protocol::LogAttribute($crate::protocol::Value::from($fmt))
);
let mut i = 0;
let mut i = 0usize;
$(
attributes.insert(
format!("sentry.message.parameter.{}", i),
$crate::protocol::LogAttribute($crate::protocol::Value::from($arg))
);
i += 1;
i = i.checked_add(1).expect("number of parametrs should not overflow usize");
)*
let _ = i; // avoid triggering the `unused_assignments` lint

Expand Down
2 changes: 2 additions & 0 deletions sentry-core/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! <https://develop.sentry.dev/sdk/sessions/>

#![expect(clippy::arithmetic_side_effects)] // https://github.com/getsentry/sentry-rust/issues/1117

#[cfg(feature = "release-health")]
pub use session_impl::*;

Expand Down
2 changes: 2 additions & 0 deletions sentry-types/src/protocol/envelope.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![expect(clippy::arithmetic_side_effects)] // https://github.com/getsentry/sentry-rust/issues/1118

use std::{borrow::Cow, io::Write, path::Path, time::SystemTime};

use serde::{Deserialize, Serialize};
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/transports/ratelimit.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![expect(clippy::arithmetic_side_effects)] // https://github.com/getsentry/sentry-rust/issues/1115

use httpdate::parse_http_date;
use std::time::{Duration, SystemTime};

Expand Down
Loading