Skip to content

Commit

Permalink
Fix clippy::used_underscore_binding
Browse files Browse the repository at this point in the history
  • Loading branch information
SchahinRohani committed Oct 17, 2024
1 parent f5de318 commit aba9822
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect

# TODO(aaronmondal): Extend these flags until we can run with clippy::pedantic.
build --@rules_rust//:clippy_flags=-Dwarnings,-Dclippy::uninlined_format_args,-Dclippy::manual_string_new,-Dclippy::manual_let_else,-Dclippy::single_match_else,-Dclippy::redundant_closure_for_method_calls,-Dclippy::semicolon_if_nothing_returned,-Dclippy::unreadable_literal,-Dclippy::range_plus_one,-Dclippy::inconsistent_struct_constructor,-Dclippy::match_wildcard_for_single_variants,-Dclippy::implicit_clone
build --@rules_rust//:clippy_flags=-Dwarnings,-Dclippy::uninlined_format_args,-Dclippy::manual_string_new,-Dclippy::manual_let_else,-Dclippy::single_match_else,-Dclippy::redundant_closure_for_method_calls,-Dclippy::semicolon_if_nothing_returned,-Dclippy::unreadable_literal,-Dclippy::range_plus_one,-Dclippy::inconsistent_struct_constructor,-Dclippy::match_wildcard_for_single_variants,-Dclippy::implicit_clone,-Dclippy::used_underscore_binding
build --@rules_rust//:clippy.toml=//:clippy.toml

test --@rules_rust//:rustfmt.toml=//:.rustfmt.toml
Expand Down
10 changes: 2 additions & 8 deletions nativelink-store/src/s3_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ use nativelink_metric::MetricsComponent;
use nativelink_util::buf_channel::{
make_buf_channel_pair, DropCloserReadHalf, DropCloserWriteHalf,
};
use nativelink_util::fs;
use nativelink_util::health_utils::{HealthStatus, HealthStatusIndicator};
use nativelink_util::instant_wrapper::InstantWrapper;
use nativelink_util::retry::{Retrier, RetryResult};
Expand All @@ -58,7 +57,7 @@ use rand::rngs::OsRng;
use rand::Rng;
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
use tokio::net::TcpStream;
use tokio::sync::{mpsc, SemaphorePermit};
use tokio::sync::mpsc;
use tokio::time::sleep;
use tracing::{event, Level};

Expand Down Expand Up @@ -86,7 +85,6 @@ const DEFAULT_MULTIPART_MAX_CONCURRENT_UPLOADS: usize = 10;

pub struct ConnectionWithPermit<T: Connection + AsyncRead + AsyncWrite + Unpin> {
connection: T,
_permit: SemaphorePermit<'static>,
}

impl<T: Connection + AsyncRead + AsyncWrite + Unpin> Connection for ConnectionWithPermit<T> {
Expand Down Expand Up @@ -174,13 +172,9 @@ impl TlsConnector {
req: &Uri,
) -> Result<ConnectionWithPermit<MaybeHttpsStream<TcpStream>>, Error> {
let retry_stream_fn = unfold(self.connector.clone(), move |mut connector| async move {
let _permit = fs::get_permit().await.unwrap();
match connector.call(req.clone()).await {
Ok(connection) => Some((
RetryResult::Ok(ConnectionWithPermit {
connection,
_permit,
}),
RetryResult::Ok(ConnectionWithPermit { connection }),
connector,
)),
Err(e) => Some((
Expand Down

0 comments on commit aba9822

Please sign in to comment.