Format codebase with rustfmt

This commit is contained in:
thePR0M3TH3AN
2025-05-21 11:24:49 -04:00
parent 9360efee2a
commit 567f1cd1a5
33 changed files with 780 additions and 481 deletions

View File

@@ -28,7 +28,9 @@ fn generate_cheatsheet() -> Result<(), Box<dyn std::error::Error>> {
for (cmd_name_val, cmd_details_val) in cmds {
let cmd_name = cmd_name_val.as_str().unwrap_or("");
if let Value::Mapping(cmd_details) = cmd_details_val {
if let Some(Value::Mapping(actions)) = cmd_details.get(&Value::String("actions".into())) {
if let Some(Value::Mapping(actions)) =
cmd_details.get(&Value::String("actions".into()))
{
for (action_name_val, action_body_val) in actions {
let action_name = action_name_val.as_str().unwrap_or("");
let flags = if let Value::Mapping(action_map) = action_body_val {
@@ -45,7 +47,11 @@ fn generate_cheatsheet() -> Result<(), Box<dyn std::error::Error>> {
};
let flags_disp = if flags.is_empty() { "" } else { &flags };
table.push_str(&format!("| `{}` | {} |\n", format!("{} {}", cmd_name, action_name), flags_disp));
table.push_str(&format!(
"| `{}` | {} |\n",
format!("{} {}", cmd_name, action_name),
flags_disp
));
}
}
}