Skip to content

Commit

Permalink
ref: Pacify clippy (getsentry#527)
Browse files Browse the repository at this point in the history
Mostly unnecessary refs.
  • Loading branch information
Swatinem authored Nov 29, 2022
1 parent 3419eee commit 7da6009
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sentry-contexts/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_version::{version, version_meta, Channel};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let out_dir = env::var("OUT_DIR")?;
let dest_path = Path::new(&out_dir).join("constants.gen.rs");
let mut f = File::create(&dest_path)?;
let mut f = File::create(dest_path)?;

let target = env::var("TARGET")?;
let mut target_bits = target.split('-');
Expand Down
8 changes: 7 additions & 1 deletion sentry-core/src/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,13 @@ impl Transaction {
Some(protocol::Transaction {
name: Some(ctx.name),
#[cfg(all(feature = "profiling", target_family = "unix"))]
active_thread_id: Some(unsafe { libc::pthread_self() as u64 }),
active_thread_id: Some(
// NOTE: `pthread_t` is a `usize`, so clippy is wrong complaining about this cast
#[allow(clippy::unnecessary_cast)]
unsafe {
libc::pthread_self() as u64
},
),
..Default::default()
}),
),
Expand Down
4 changes: 2 additions & 2 deletions sentry/src/transports/curl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ impl CurlHttpTransport {
}

match (scheme, &http_proxy, &https_proxy) {
(Scheme::Https, _, &Some(ref proxy)) => {
(Scheme::Https, _, Some(proxy)) => {
if let Err(err) = handle.proxy(proxy) {
sentry_debug!("invalid proxy: {:?}", err);
}
}
(_, &Some(ref proxy), _) => {
(_, Some(proxy), _) => {
if let Err(err) = handle.proxy(proxy) {
sentry_debug!("invalid proxy: {:?}", err);
}
Expand Down
4 changes: 2 additions & 2 deletions sentry/src/transports/ureq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ impl UreqHttpTransport {
}

match (scheme, &options.http_proxy, &options.https_proxy) {
(Scheme::Https, _, &Some(ref proxy)) => match Proxy::new(proxy) {
(Scheme::Https, _, Some(proxy)) => match Proxy::new(proxy) {
Ok(proxy) => {
builder = builder.proxy(proxy);
}
Err(err) => {
sentry_debug!("invalid proxy: {:?}", err);
}
},
(_, &Some(ref proxy), _) => match Proxy::new(proxy) {
(_, Some(proxy), _) => match Proxy::new(proxy) {
Ok(proxy) => {
builder = builder.proxy(proxy);
}
Expand Down

0 comments on commit 7da6009

Please sign in to comment.