cargo clippy ran
This commit is contained in:
@@ -210,7 +210,7 @@ impl<D: DataProvider> AutoCursorFormEditor<D> {
|
||||
self.has_unsaved_changes = true;
|
||||
self.debug_message = "⌫ Deleted character backward".to_string();
|
||||
}
|
||||
Ok(result?)
|
||||
result
|
||||
}
|
||||
|
||||
fn delete_forward(&mut self) -> anyhow::Result<()> {
|
||||
@@ -219,7 +219,7 @@ impl<D: DataProvider> AutoCursorFormEditor<D> {
|
||||
self.has_unsaved_changes = true;
|
||||
self.debug_message = "⌦ Deleted character forward".to_string();
|
||||
}
|
||||
Ok(result?)
|
||||
result
|
||||
}
|
||||
|
||||
// === SUGGESTIONS CONTROL WRAPPERS ===
|
||||
@@ -251,7 +251,7 @@ impl<D: DataProvider> AutoCursorFormEditor<D> {
|
||||
if result.is_ok() {
|
||||
self.has_unsaved_changes = true;
|
||||
}
|
||||
Ok(result?)
|
||||
result
|
||||
}
|
||||
|
||||
// === PRODUCTION-READY NON-BLOCKING SUGGESTIONS ===
|
||||
@@ -275,7 +275,7 @@ impl<D: DataProvider> AutoCursorFormEditor<D> {
|
||||
if applied {
|
||||
self.editor.update_inline_completion();
|
||||
if self.editor.suggestions().is_empty() {
|
||||
self.set_debug_message(format!("🔍 No matches for '{}'", query));
|
||||
self.set_debug_message(format!("🔍 No matches for '{query}'"));
|
||||
} else {
|
||||
self.set_debug_message(format!("✨ {} matches for '{}'", self.editor.suggestions().len(), query));
|
||||
}
|
||||
@@ -283,7 +283,7 @@ impl<D: DataProvider> AutoCursorFormEditor<D> {
|
||||
// If not applied, results were stale (user kept typing)
|
||||
}
|
||||
Err(e) => {
|
||||
self.set_debug_message(format!("❌ Suggestion error: {}", e));
|
||||
self.set_debug_message(format!("❌ Suggestion error: {e}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -574,7 +574,7 @@ impl ProductionSuggestionsProvider {
|
||||
query.is_empty() || item.to_lowercase().starts_with(&query_lower)
|
||||
})
|
||||
.map(|(item, description)| SuggestionItem {
|
||||
display_text: format!("{} - {}", item, description),
|
||||
display_text: format!("{item} - {description}"),
|
||||
value_to_store: item.to_string(),
|
||||
})
|
||||
.collect()
|
||||
@@ -634,7 +634,7 @@ async fn handle_key_press(
|
||||
(_, KeyCode::Enter, _) => {
|
||||
if editor.is_suggestions_active() {
|
||||
if let Some(applied) = editor.apply_suggestion() {
|
||||
editor.set_debug_message(format!("✅ Selected: {}", applied));
|
||||
editor.set_debug_message(format!("✅ Selected: {applied}"));
|
||||
} else {
|
||||
editor.set_debug_message("❌ No suggestion selected".to_string());
|
||||
}
|
||||
@@ -642,7 +642,7 @@ async fn handle_key_press(
|
||||
editor.next_field();
|
||||
let field_names = ["Fruit", "Job", "Language", "Country", "Color"];
|
||||
let field_name = field_names.get(editor.current_field()).unwrap_or(&"Field");
|
||||
editor.set_debug_message(format!("Enter: moved to {} field", field_name));
|
||||
editor.set_debug_message(format!("Enter: moved to {field_name} field"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -722,7 +722,7 @@ async fn handle_key_press(
|
||||
editor.move_down();
|
||||
let field_names = ["Fruit", "Job", "Language", "Country", "Color"];
|
||||
let field_name = field_names.get(editor.current_field()).unwrap_or(&"Field");
|
||||
editor.set_debug_message(format!("↓ moved to {} field", field_name));
|
||||
editor.set_debug_message(format!("↓ moved to {field_name} field"));
|
||||
editor.clear_command_buffer();
|
||||
}
|
||||
(AppMode::ReadOnly | AppMode::Highlight, KeyCode::Char('k'), _)
|
||||
@@ -730,7 +730,7 @@ async fn handle_key_press(
|
||||
editor.move_up();
|
||||
let field_names = ["Fruit", "Job", "Language", "Country", "Color"];
|
||||
let field_name = field_names.get(editor.current_field()).unwrap_or(&"Field");
|
||||
editor.set_debug_message(format!("↑ moved to {} field", field_name));
|
||||
editor.set_debug_message(format!("↑ moved to {field_name} field"));
|
||||
editor.clear_command_buffer();
|
||||
}
|
||||
|
||||
@@ -872,8 +872,7 @@ async fn handle_key_press(
|
||||
let field_names = ["Fruit", "Job", "Language", "Country", "Color"];
|
||||
let current_field = field_names.get(editor.current_field()).unwrap_or(&"Field");
|
||||
editor.set_debug_message(format!(
|
||||
"{} field - Try: i=insert, Tab=suggestions, j/k=move. Key: {:?}",
|
||||
current_field, key
|
||||
"{current_field} field - Try: i=insert, Tab=suggestions, j/k=move. Key: {key:?}"
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -899,7 +898,7 @@ async fn run_app<B: Backend>(
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
editor.set_debug_message(format!("Error: {}", e));
|
||||
editor.set_debug_message(format!("Error: {e}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -922,7 +921,7 @@ fn ui(f: &mut Frame, editor: &AutoCursorFormEditor<ApplicationData>) {
|
||||
f,
|
||||
chunks[0],
|
||||
input_rect,
|
||||
&canvas::canvas::theme::DefaultCanvasTheme::default(),
|
||||
&canvas::canvas::theme::DefaultCanvasTheme,
|
||||
&editor.editor,
|
||||
);
|
||||
}
|
||||
@@ -1071,7 +1070,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
terminal.show_cursor()?;
|
||||
|
||||
if let Err(err) = res {
|
||||
println!("{:?}", err);
|
||||
println!("{err:?}");
|
||||
}
|
||||
|
||||
println!("🚀 Ready to integrate this architecture into your production app!");
|
||||
|
||||
Reference in New Issue
Block a user