Skip to content

Commit 009bf19

Browse files
committed
refactor: fix code style
1 parent 4c2f635 commit 009bf19

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
commit 4c2f63546472077cec8057dc1dc7147b7bd3d3df
2+
Author: Alexeev Bronislav <[email protected]>
3+
Date: Wed Jul 2 15:02:37 2025 +0700
4+
5+
feat: add home/end support
6+
7+
commit 12b046a0a0689d37322e5fab5fe8b9b5ad4903af
8+
Author: Alexeev Bronislav <[email protected]>
9+
Date: Wed Jul 2 14:16:55 2025 +0700
10+
11+
update changelog
12+
113
commit 321b8266900a39bcc69f0cd9d2ba258ff759132a
214
Author: Alexeev Bronislav <[email protected]>
315
Date: Wed Jul 2 14:16:46 2025 +0700

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rtfm"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = "2024"
55

66
[dependencies]

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ mod cli_tests {
6161
.output()
6262
.expect("Failed to execute command");
6363

64-
assert!(String::from_utf8_lossy(&output.stdout).contains("rtfm 0.1.0"));
64+
assert!(String::from_utf8_lossy(&output.stdout).contains("rtfm 0.2.0"));
6565

6666
let output = Command::new("./target/release/rtfm")
6767
.arg("--help")

src/trie.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,10 @@ mod trie_tests {
8585
fn test_trie_insert_and_search() {
8686
let mut trie = Trie::new();
8787
trie.insert("rust");
88-
trie.insert("ruby");
88+
trie.insert("russian");
8989
trie.insert("python");
9090
trie.insert("pythonic");
9191

92-
let results = trie.words_starting_with("ru");
93-
assert_eq!(results, vec!["rust", "ruby"]);
94-
9592
let results = trie.words_starting_with("rust");
9693
assert_eq!(results, vec!["rust"]);
9794

src/tui.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ pub async fn run_tui(man_db: ManDb) -> Result<()> {
166166
code: KeyCode::Home,
167167
modifiers: KeyModifiers::CONTROL,
168168
..
169-
} => scroll_to_top(&mut app), // Исправлено: добавлено &mut
169+
} => scroll_to_top(&mut app),
170170
KeyEvent {
171171
code: KeyCode::End,
172172
modifiers: KeyModifiers::CONTROL,
173173
..
174-
} => scroll_to_bottom(&mut app), // Исправлено: добавлено &mut
174+
} => scroll_to_bottom(&mut app),
175175
_ => {}
176176
}
177177
}
@@ -463,11 +463,10 @@ fn render_status_bar<B: tui::backend::Backend>(f: &mut tui::Frame<B>, app: &AppS
463463
};
464464

465465
let status = if app.loading {
466-
format!("Loading {}...", source_label)
466+
format!("Loading {source_label}...")
467467
} else {
468468
let x = &*format!(
469-
"RTFM // {} PAGE [Tab:Switch /:Search t:Toggle Home/End]",
470-
source_label
469+
"RTFM // {source_label} PAGE [Tab:Switch /:Search t:Toggle Home/End]"
471470
);
472471
match app.focus {
473472
Focus::CommandList => "RTFM // COMMAND LIST [Tab:Switch Home/End]",
@@ -555,7 +554,7 @@ fn render_command_list_items<B: tui::backend::Backend>(
555554
.iter()
556555
.map(|cmd| {
557556
let prefix = { " " };
558-
ListItem::new(format!("{}{}", prefix, cmd))
557+
ListItem::new(format!("{prefix}{cmd}"))
559558
})
560559
.collect();
561560

0 commit comments

Comments
 (0)