refactor: Renamed KeyEventHandler::with to KeyEventHandler::new to keep with Rust best practices and conventions
This commit is contained in:
@@ -27,7 +27,7 @@ mod tests {
|
||||
app.is_loading = is_ready;
|
||||
app.data.sonarr_data.main_tabs.set_index(6);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.left.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -49,7 +49,7 @@ mod tests {
|
||||
app.is_loading = is_ready;
|
||||
app.data.sonarr_data.main_tabs.set_index(6);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.right.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -80,7 +80,7 @@ mod tests {
|
||||
app.push_navigation_stack(ActiveSonarrBlock::System.into());
|
||||
app.push_navigation_stack(ActiveSonarrBlock::System.into());
|
||||
|
||||
SystemHandler::with(ESC_KEY, &mut app, ActiveSonarrBlock::System, None).handle();
|
||||
SystemHandler::new(ESC_KEY, &mut app, ActiveSonarrBlock::System, None).handle();
|
||||
|
||||
assert_eq!(app.get_current_route(), ActiveSonarrBlock::System.into());
|
||||
assert!(app.error.text.is_empty());
|
||||
@@ -113,7 +113,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.update.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -147,7 +147,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.update.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -177,7 +177,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.events.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -211,7 +211,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.events.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -241,7 +241,7 @@ mod tests {
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
app.push_navigation_stack(ActiveSonarrBlock::System.into());
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.refresh.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -274,7 +274,7 @@ mod tests {
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
app.push_navigation_stack(ActiveSonarrBlock::System.into());
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.refresh.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -305,7 +305,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.logs.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -347,7 +347,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.logs.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -378,7 +378,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.tasks.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -412,7 +412,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
SystemHandler::with(
|
||||
SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.tasks.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -462,7 +462,7 @@ mod tests {
|
||||
app.push_navigation_stack(ActiveSonarrBlock::System.into());
|
||||
app.is_loading = true;
|
||||
|
||||
let system_handler = SystemHandler::with(
|
||||
let system_handler = SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.update.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -488,7 +488,7 @@ mod tests {
|
||||
.queued_events
|
||||
.set_items(vec![QueueEvent::default()]);
|
||||
|
||||
let system_handler = SystemHandler::with(
|
||||
let system_handler = SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.update.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -510,7 +510,7 @@ mod tests {
|
||||
.queued_events
|
||||
.set_items(vec![QueueEvent::default()]);
|
||||
|
||||
let system_handler = SystemHandler::with(
|
||||
let system_handler = SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.update.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -532,7 +532,7 @@ mod tests {
|
||||
.tasks
|
||||
.set_items(vec![SonarrTask::default()]);
|
||||
|
||||
let system_handler = SystemHandler::with(
|
||||
let system_handler = SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.update.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
@@ -559,7 +559,7 @@ mod tests {
|
||||
.queued_events
|
||||
.set_items(vec![QueueEvent::default()]);
|
||||
|
||||
let system_handler = SystemHandler::with(
|
||||
let system_handler = SystemHandler::new(
|
||||
DEFAULT_KEYBINDINGS.update.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::System,
|
||||
|
||||
Reference in New Issue
Block a user