From 036e7de2b6f3b5761e1ecf3bb7805bc98e55379c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Fri, 31 Jan 2025 18:01:00 +0100 Subject: [PATCH] fix --- src/portable/project/init.rs | 4 ++-- src/watch/fs_watcher.rs | 2 +- src/watch/main.rs | 2 +- src/watch/mod.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/portable/project/init.rs b/src/portable/project/init.rs index ba748579..f6d5f6fe 100644 --- a/src/portable/project/init.rs +++ b/src/portable/project/init.rs @@ -404,7 +404,7 @@ fn do_init( let handle = project::Handle { name: name.into(), project_dir: project.location.root.clone(), - schema_dir: project.resolve_schema_dir()?.into(), + schema_dir: project.resolve_schema_dir()?, instance, database: options.database.clone(), }; @@ -453,7 +453,7 @@ fn do_cloud_init( let handle = project::Handle { name: full_name.clone(), project_dir: project.location.root.clone(), - schema_dir: project.resolve_schema_dir()?.into(), + schema_dir: project.resolve_schema_dir()?, instance: project::InstanceKind::Remote, database: Some(database.to_owned()), }; diff --git a/src/watch/fs_watcher.rs b/src/watch/fs_watcher.rs index e4a3c72a..0ee3f9af 100644 --- a/src/watch/fs_watcher.rs +++ b/src/watch/fs_watcher.rs @@ -28,7 +28,7 @@ impl FsWatcher { #[allow(dead_code)] pub fn clear_queue(&mut self) { - while let Ok(_) = self.rx.try_recv() {} + while self.rx.try_recv().is_ok() {} } /// Waits for either changes in fs, timeout or interrupt signal diff --git a/src/watch/main.rs b/src/watch/main.rs index bf73f410..965dc900 100644 --- a/src/watch/main.rs +++ b/src/watch/main.rs @@ -45,7 +45,7 @@ pub fn run(options: &Options, _watch: &WatchCommand) -> anyhow::Result<()> { ); runtime.block_on(async { let mut retry_timeout = None::; - while let Ok(_) = watcher.wait(retry_timeout).await { + while watcher.wait(retry_timeout).await.is_ok() { if let Err(e) = ctx.do_update().await { log::error!("Error updating database: {e:#}. Will retry in 10s."); retry_timeout = Some(Duration::from_secs(10)); diff --git a/src/watch/mod.rs b/src/watch/mod.rs index adfb7ed2..a0b165c8 100644 --- a/src/watch/mod.rs +++ b/src/watch/mod.rs @@ -1,8 +1,8 @@ mod fs_watcher; mod main; -pub use main::run; pub use fs_watcher::FsWatcher; +pub use main::run; #[derive(clap::Args, Debug, Clone)] pub struct WatchCommand {