-
Notifications
You must be signed in to change notification settings - Fork 946
Open
Description
Current formatted code:
fn too_long_function_name_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxxxxxxxxxx()
-> Option<i32> {
None
}
fn main() {
if let Some(x) =
too_long_function_name_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxxxxxxxxxx()
&& x != 0
{
println!("x")
}
}
If you don't pay attention to the =
at the end of the previous line,
you may think that this call returns a bool
Expect improved formatted code:
fn too_long_function_name_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxxxxxxxxxx()
-> Option<i32> {
None
}
fn main() {
if let Some(x)
= too_long_function_name_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxxxxxxxxxx()
&& x != 0
{
println!("x")
}
}
or
fn too_long_function_name_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxxxxxxxxxx()
-> Option<i32> {
None
}
fn main() {
if let Some(x) =
too_long_function_name_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcxxxxxxxxxxxxxxxxxxxx()
&& x != 0
{
println!("x")
}
}
Metadata
Metadata
Assignees
Labels
No labels