Move configure out of run

This commit is contained in:
Ulf Lilleengen
2024-09-05 10:31:51 +02:00
parent 836e8add1b
commit 5d0ed24640
2 changed files with 3 additions and 3 deletions

View File

@@ -284,8 +284,7 @@ impl<'a> Control<'a> {
}
/// Run a control loop for this context, ensuring that reaattach is handled.
pub async fn run<F: Fn(&Status)>(&self, config: &Config<'_>, reattach: F) -> Result<(), Error> {
self.configure(config).await?;
pub async fn run<F: Fn(&Status)>(&self, reattach: F) -> Result<(), Error> {
let status = self.wait_attached().await?;
let mut fd = self.control.open_raw_socket().await;
reattach(&status);