Skip to content

Commit 41518be

Browse files
committed
Remove unused menu parameter from App constructor
1 parent 335371d commit 41518be

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎src/app.rs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ impl App {
3838
&self.agent_manager
3939
}
4040

41-
pub async fn new(_menu: Menu, icons: Arc<Icons>, scan_duration: u64) -> Result<Self> {
41+
pub async fn new(icons: Arc<Icons>, scan_duration: u64) -> Result<Self> {
4242
let session = Arc::new(Session::new().await?);
4343
let notification_manager = Arc::new(NotificationManager::new(icons.clone()));
4444

45-
let notification_manager_handler: Arc<dyn PairingConfirmationHandler> =
46-
notification_manager.clone();
47-
48-
let agent_manager =
49-
AgentManager::new(session.clone(), notification_manager_handler).await?;
45+
let agent_manager = AgentManager::new(
46+
session.clone(),
47+
notification_manager.clone() as Arc<dyn PairingConfirmationHandler>,
48+
)
49+
.await?;
5050

5151
let controller = Controller::new(session.clone()).await?;
5252

‎src/main.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async fn run_app_loop(
152152
icons: Arc<Icons>,
153153
scan_duration: u64,
154154
) -> Result<()> {
155-
let mut app = App::new(menu.clone(), icons.clone(), scan_duration).await?;
155+
let mut app = App::new(icons.clone(), scan_duration).await?;
156156

157157
loop {
158158
match app.run(menu, command_str, icon_type, spaces).await {
@@ -170,8 +170,7 @@ async fn run_app_loop(
170170
}
171171

172172
if app.reset_mode {
173-
app = App::new(menu.clone(), icons.clone(), scan_duration).await?;
174-
173+
app = App::new(icons.clone(), scan_duration).await?;
175174
app.reset_mode = false;
176175
}
177176
}

0 commit comments

Comments
 (0)