Skip to content

Commit

Permalink
🎨 extend rustfmt config with other small heuristics settings; format
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 21, 2024
1 parent a0fe24c commit 6733c8d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 5 additions & 2 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# https://rust-lang.github.io/rustfmt/?version=master&search=fn_call_#use_small_heuristics
hard_tabs = true
max_width = 120
array_width = 80
fn_call_width = 80
attr_fn_like_width = 80
chain_width = 80
struct_lit_width = 36
array_width = 80
chain_width = 80
single_line_if_else_max_width = 80
single_line_let_else_max_width = 80
4 changes: 1 addition & 3 deletions src/modules/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ impl Config {
let mut config = Self::default();

let path = Self::get_path();
let Ok(file) = fs::read_to_string(&path) else {
return config;
};
let Ok(file) = fs::read_to_string(&path) else { return config };

match Options::default()
.with_default_extension(Extensions::IMPLICIT_SOME)
Expand Down
6 changes: 1 addition & 5 deletions src/modules/display/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ pub fn style_number(mut num: i32, sub: bool) -> String {
let mut result = String::new();

if num == 0 {
result.push(if sub {
SUBSCRIPT_DIGITS[0]
} else {
SUPERSCRIPT_DIGITS[0]
});
result.push(if sub { SUBSCRIPT_DIGITS[0] } else { SUPERSCRIPT_DIGITS[0] });
return result;
}

Expand Down

0 comments on commit 6733c8d

Please sign in to comment.