Skip to content

Commit

Permalink
Fix clippy::return_self_not_must_use (TraceMachina#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchahinRohani authored Oct 25, 2024
1 parent 6ed0455 commit 6fcb3bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
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,-Dclippy::needless_pass_by_value,-Dclippy::explicit_deref_methods,-Dclippy::trivially_copy_pass_by_ref,-Dclippy::unnecessary_wraps,-Dclippy::cast_lossless,-Dclippy::map_unwrap_or,-Dclippy::ref_as_ptr,-Dclippy::inline_always,-Dclippy::redundant_else
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::needless_pass_by_value,-Dclippy::explicit_deref_methods,-Dclippy::trivially_copy_pass_by_ref,-Dclippy::unnecessary_wraps,-Dclippy::cast_lossless,-Dclippy::map_unwrap_or,-Dclippy::ref_as_ptr,-Dclippy::inline_always,-Dclippy::redundant_else,-Dclippy::return_self_not_must_use
build --@rules_rust//:clippy.toml=//:clippy.toml

test --@rules_rust//:rustfmt.toml=//:.rustfmt.toml
Expand Down
1 change: 1 addition & 0 deletions nativelink-util/src/health_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ impl HealthRegistryBuilder {
}

/// Create a sub builder for a namespace.
#[must_use]
pub fn sub_builder(&mut self, namespace: &str) -> HealthRegistryBuilder {
HealthRegistryBuilder {
namespace: format!("{}/{}", self.namespace, namespace).into(),
Expand Down
1 change: 1 addition & 0 deletions nativelink-util/src/store_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ impl<'a> StoreKey<'a> {
/// Returns a shallow clone of the key.
/// This is extremely cheap and should be used when clone
/// is needed but the key is not going to be modified.
#[must_use]
pub fn borrow(&'a self) -> StoreKey<'a> {
match self {
StoreKey::Str(Cow::Owned(s)) => StoreKey::Str(Cow::Borrowed(s)),
Expand Down

0 comments on commit 6fcb3bb

Please sign in to comment.