From d7fef30ac3f539975ef9edbba8e0af4a4e9ff3de Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 5 Jan 2025 00:38:55 +0100 Subject: Commit batch of lints to allow autofix --- src/remote/mod.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/remote/mod.rs') diff --git a/src/remote/mod.rs b/src/remote/mod.rs index 19514af..49bfeb0 100644 --- a/src/remote/mod.rs +++ b/src/remote/mod.rs @@ -26,8 +26,8 @@ pub fn remove(remote_config: &PathBuf) -> Result<()> { } pub fn sync_up(data_directory: &PathBuf, remote_config: &PathBuf) -> Result<()> { - let remote_address = read_remote(remote_config) - .ok_or_else(|| Error::new(Other, "No remote is configured"))?; + let remote_address = + read_remote(remote_config).ok_or_else(|| Error::new(Other, "No remote is configured"))?; create_dir_all(data_directory)?; let remotes = available_remotes(); for remote in remotes { @@ -35,12 +35,15 @@ pub fn sync_up(data_directory: &PathBuf, remote_config: &PathBuf) -> Result<()> return remote.sync_up(&remote_address, data_directory); } } - Err(Error::new(Other, "No valid strategies found for your configured remote.")) + Err(Error::new( + Other, + "No valid strategies found for your configured remote.", + )) } pub fn sync_down(data_directory: &PathBuf, remote_config: &PathBuf) -> Result<()> { - let remote_address = read_remote(remote_config) - .ok_or_else(|| Error::new(Other, "No remote is configured"))?; + let remote_address = + read_remote(remote_config).ok_or_else(|| Error::new(Other, "No remote is configured"))?; create_dir_all(data_directory)?; let remotes = available_remotes(); for remote in remotes { @@ -48,13 +51,14 @@ pub fn sync_down(data_directory: &PathBuf, remote_config: &PathBuf) -> Result<() return remote.sync_down(&remote_address, data_directory); } } - Err(Error::new(Other, "No valid strategies found for your configured remote.")) + Err(Error::new( + Other, + "No valid strategies found for your configured remote.", + )) } fn available_remotes() -> Vec> { - vec![ - Box::new(Git::new()) - ] + vec![Box::new(Git::new())] } fn read_remote(file_path: &PathBuf) -> Option { -- cgit