Simple tool for automatic file management

chore: reformat code

hauleth.dev 8068c0e4 b1fc5149

verified
Changed files
+11 -5
src
+5 -1
src/actions.rs
···
impl Action {
pub async fn run(self, source: PathBuf, execute: bool) {
-
if execute { self.execute(source).await } else { self.dry_run(source).await }
+
if execute {
+
self.execute(source).await
+
} else {
+
self.dry_run(source).await
+
}
}
pub async fn dry_run(self, source: PathBuf) {
+4 -2
src/job.rs
···
use serde::Deserialize;
-
use crate::filters::Filter;
use crate::actions::Action;
+
use crate::filters::Filter;
/// Definition of the job files
#[derive(Debug, Deserialize)]
···
impl Job {
/// Returns stream of actions that should be executed
-
pub async fn actions(&self) -> Result<impl tokio_stream::Stream<Item = (Action, PathBuf)> + '_> {
+
pub async fn actions(
+
&self,
+
) -> Result<impl tokio_stream::Stream<Item = (Action, PathBuf)> + '_> {
let loc = normalise_path(&self.location);
let dir = ReadDirStream::new(fs::read_dir(&loc).await?);
+2 -2
src/main.rs
···
+
use clap::Parser;
use color_eyre::eyre::Result;
use futures::prelude::*;
-
use clap::Parser;
use std::io::Read;
+
mod actions;
mod filters;
mod job;
mod pattern;
-
mod actions;
#[derive(Debug, Parser)]
struct Args {