diff --git a/app/buck2_client_ctx/src/events_ctx.rs b/app/buck2_client_ctx/src/events_ctx.rs index 4ab4e0901fe9..e23aabac8b96 100644 --- a/app/buck2_client_ctx/src/events_ctx.rs +++ b/app/buck2_client_ctx/src/events_ctx.rs @@ -71,9 +71,9 @@ impl From for BuckdCommunicationError { #[async_trait] pub trait PartialResultHandler { type PartialResult: TryFrom< - buck2_cli_proto::partial_result::PartialResult, - Error = buck2_cli_proto::partial_result::PartialResult, - >; + buck2_cli_proto::partial_result::PartialResult, + Error = buck2_cli_proto::partial_result::PartialResult, + >; async fn handle_partial_result( &mut self, diff --git a/app/buck2_core/src/cells/nested.rs b/app/buck2_core/src/cells/nested.rs index 986115bc2ef0..45ec91ab502a 100644 --- a/app/buck2_core/src/cells/nested.rs +++ b/app/buck2_core/src/cells/nested.rs @@ -52,9 +52,10 @@ impl NestedCells { all_cells: &[(CellName, &CellRootPath)], this_cell: &CellRootPath, ) -> NestedCells { - Self::from_cell_paths_relative_to_this_cell(all_cells.iter() - .filter_map(|(cell_name, cell_root_path)| { - let Some(path_relative_to_this_cell) = cell_root_path.strip_prefix_opt(this_cell) else { + Self::from_cell_paths_relative_to_this_cell(all_cells.iter().filter_map( + |(cell_name, cell_root_path)| { + let Some(path_relative_to_this_cell) = cell_root_path.strip_prefix_opt(this_cell) + else { return None; }; @@ -62,7 +63,8 @@ impl NestedCells { CellRelativePath::new(path_relative_to_this_cell), *cell_name, )) - })) + }, + )) } pub fn matches<'a, 'b>( diff --git a/app/buck2_interpreter_for_build/src/attrs/coerce/attr_type/visibility.rs b/app/buck2_interpreter_for_build/src/attrs/coerce/attr_type/visibility.rs index a99f81b8b78d..bd3a1d9b5460 100644 --- a/app/buck2_interpreter_for_build/src/attrs/coerce/attr_type/visibility.rs +++ b/app/buck2_interpreter_for_build/src/attrs/coerce/attr_type/visibility.rs @@ -70,14 +70,9 @@ pub(crate) fn parse_visibility_with_view( for item in list { let Some(item) = item.unpack_str() else { if StarlarkSelector::from_value(*item).is_some() { - return Err(VisibilityAttrTypeCoerceError::NotConfigurable( - attr.to_repr(), - ) - .into()); + return Err(VisibilityAttrTypeCoerceError::NotConfigurable(attr.to_repr()).into()); } - return Err(VisibilityAttrTypeCoerceError::WrongType( - attr.to_repr(), - ).into()); + return Err(VisibilityAttrTypeCoerceError::WrongType(attr.to_repr()).into()); }; if item == VisibilityPattern::PUBLIC { diff --git a/starlark-rust/starlark/src/eval/compiler/types.rs b/starlark-rust/starlark/src/eval/compiler/types.rs index 151c72df36b5..db51018ef1dd 100644 --- a/starlark-rust/starlark/src/eval/compiler/types.rs +++ b/starlark-rust/starlark/src/eval/compiler/types.rs @@ -73,10 +73,14 @@ impl<'v> Compiler<'v, '_, '_> { let Some(type_value) = expr.payload else { // This is unreachable. But unfortunately we do not return error here. // Still make an error in panic to produce nice panic message. - panic!("{:?}", EvalException::new( - TypesError::TypePayloadNotSet.into(), - expr.span, - &self.codemap)); + panic!( + "{:?}", + EvalException::new( + TypesError::TypePayloadNotSet.into(), + expr.span, + &self.codemap + ) + ); }; if type_value.type_is_wildcard() { return None; diff --git a/starlark-rust/starlark/src/values/types/int_or_big.rs b/starlark-rust/starlark/src/values/types/int_or_big.rs index c703f73264c7..9a5e5f7bc1f5 100644 --- a/starlark-rust/starlark/src/values/types/int_or_big.rs +++ b/starlark-rust/starlark/src/values/types/int_or_big.rs @@ -362,7 +362,7 @@ impl<'v> StarlarkIntRef<'v> { Ok(StarlarkInt::Small(InlineInt::MINUS_ONE)) } else { Ok(StarlarkInt::Small(InlineInt::ZERO)) - } + }; }; match self { diff --git a/starlark-rust/starlark/src/values/types/string/interpolation.rs b/starlark-rust/starlark/src/values/types/string/interpolation.rs index da456c10213f..867d2751b2ef 100644 --- a/starlark-rust/starlark/src/values/types/string/interpolation.rs +++ b/starlark-rust/starlark/src/values/types/string/interpolation.rs @@ -152,7 +152,9 @@ impl<'a> Iterator for PercentFormatParser<'a> { _ => { // Note we need to find the second character, not the second byte. let Some(c) = rem.chars().nth(1) else { - return Some(Err(StringInterpolationError::ExpectingFormatCharacter.into())); + return Some(Err( + StringInterpolationError::ExpectingFormatCharacter.into(), + )); }; return Some(Err( StringInterpolationError::UnsupportedFormatCharacter(c).into(), diff --git a/starlark-rust/starlark_derive/src/starlark_value.rs b/starlark-rust/starlark_derive/src/starlark_value.rs index 2be3c22afaf6..d4f3dd12fe59 100644 --- a/starlark-rust/starlark_derive/src/starlark_value.rs +++ b/starlark-rust/starlark_derive/src/starlark_value.rs @@ -89,16 +89,10 @@ fn is_impl_starlark_value( ) -> syn::Result { let err = "expected `impl StarlarkValue for ...`"; let Some((_, path, _)) = &input.trait_ else { - return Err(syn::Error::new_spanned( - input, - err, - )); + return Err(syn::Error::new_spanned(input, err)); }; let Some(last) = path.segments.last() else { - return Err(syn::Error::new_spanned( - path, - err, - )); + return Err(syn::Error::new_spanned(path, err)); }; if last.ident != "StarlarkValue" { return Err(syn::Error::new_spanned(&last.ident, err));