Skip to content

Commit

Permalink
Fix clippy::inconsistent_struct_constructor (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchahinRohani authored Oct 12, 2024
1 parent f541cbb commit 85904fb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 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
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
build --@rules_rust//:clippy.toml=//:clippy.toml

test --@rules_rust//:rustfmt.toml=//:.rustfmt.toml
Expand Down
2 changes: 1 addition & 1 deletion nativelink-service/src/bytestream_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ impl ByteStreamServer {
});
Ok(ActiveStreamGuard {
stream_state: Some(StreamState {
uuid,
tx,
store_update_fut,
uuid,
}),
bytes_received,
bytestream_server: self,
Expand Down
2 changes: 1 addition & 1 deletion nativelink-service/src/worker_api_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// limitations under the License.

use std::collections::HashMap;
use std::convert::Into;
use std::pin::Pin;
use std::sync::Arc;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::convert::Into;

use futures::stream::unfold;
use futures::Stream;
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/action_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,8 @@ impl ActionState {
.err_tip(|| "Could not convert action_digest into DigestInfo")?;

Ok(Self {
client_operation_id,
stage,
client_operation_id,
action_digest,
})
}
Expand Down
6 changes: 3 additions & 3 deletions nativelink-util/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ impl DigestInfo {
));
}
Ok(DigestInfo {
size_bytes,
packed_hash,
size_bytes,
})
}

Expand Down Expand Up @@ -285,8 +285,8 @@ impl TryFrom<Digest> for DigestInfo {
.try_into()
.map_err(|_| make_input_err!("Could not convert {} into u64", digest.size_bytes))?;
Ok(DigestInfo {
size_bytes,
packed_hash,
size_bytes,
})
}
}
Expand All @@ -302,8 +302,8 @@ impl TryFrom<&Digest> for DigestInfo {
.try_into()
.map_err(|_| make_input_err!("Could not convert {} into u64", digest.size_bytes))?;
Ok(DigestInfo {
size_bytes,
packed_hash,
size_bytes,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ impl ConnectionManagerWorker {
|err| Err((identifier, err)),
|channel| {
Ok(EstablishedChannel {
identifier,
channel,
identifier,
})
},
)
Expand Down

0 comments on commit 85904fb

Please sign in to comment.