diff --git a/src/args.rs b/src/args.rs index ed328f3..0375b89 100644 --- a/src/args.rs +++ b/src/args.rs @@ -43,5 +43,5 @@ fn default_repo() -> &'static str { .to_string_lossy() .into(); } - &*DEFAULT_REPO + &DEFAULT_REPO } diff --git a/src/fs_access/buffered.rs b/src/fs_access/buffered.rs index e3e844a..fb6fb8c 100644 --- a/src/fs_access/buffered.rs +++ b/src/fs_access/buffered.rs @@ -161,7 +161,7 @@ fn ensure_parent(parent: &Path) -> Result<(), miette::ErrReport> { return Ok(()); } log::info!("Creating {parent:?}"); - fs::create_dir_all(&parent) + fs::create_dir_all(parent) .into_diagnostic() .with_context(|| format!("Creating directory {parent:?}")) } diff --git a/src/main.rs b/src/main.rs index b4b9d18..77562dc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,7 +20,7 @@ fn main() -> Result<()> { init_logging(args.verbose); match &args.command { - args::Command::Init(init_args) => init(&args, &init_args)?, + args::Command::Init(init_args) => init(&args, init_args)?, args::Command::Apply => apply(&args)?, args::Command::Context => { let repo = SiloRepo::open(&args.repo)?; @@ -98,8 +98,7 @@ fn init_remote(args: &Args, _init_args: &InitArgs, remote: &str) -> Result<()> { .0 .main_worktree(Discard, &interrupt) .into_diagnostic() - .context("checkout main")? - .0; + .context("checkout main")?; log::info!("Repo initialized at {:?}", args.repo); Ok(()) } diff --git a/src/repo/contents.rs b/src/repo/contents.rs index 83a9c47..d3e01f9 100644 --- a/src/repo/contents.rs +++ b/src/repo/contents.rs @@ -96,7 +96,7 @@ impl DirEntry { let entry_path = read_entry.path(); let test_path = entry_path.strip_prefix(&path).into_diagnostic()?; - if !IGNORED_PATHS.is_match(&test_path) && !ctx.ignored.is_match(&test_path) { + if !IGNORED_PATHS.is_match(test_path) && !ctx.ignored.is_match(test_path) { children.push(DirEntry::parse(ctx.clone(), entry_path)?); } else { log::debug!("Entry {entry_path:?} is ignored") diff --git a/src/repo/hooks.rs b/src/repo/hooks.rs index 9b85879..83e2e06 100644 --- a/src/repo/hooks.rs +++ b/src/repo/hooks.rs @@ -45,10 +45,10 @@ impl Hooks { pub fn parse(path: &Path) -> Result { log::debug!("Parsing hooks in {path:?}"); - let mut readdir = fs::read_dir(path).into_diagnostic()?; + let readdir = fs::read_dir(path).into_diagnostic()?; let mut scripts = Vec::new(); - while let Some(entry) = readdir.next() { + for entry in readdir { let path = entry.into_diagnostic()?.path(); if path.is_file() && path.extension().is_some_and(|e| e == "nu") { diff --git a/src/scripting/require.rs b/src/scripting/require.rs index b851e17..22017fe 100644 --- a/src/scripting/require.rs +++ b/src/scripting/require.rs @@ -12,10 +12,10 @@ pub fn register_require(lua: &Lua) -> Result<()> { Ok(()) } -fn lua_require<'a>(lua: &'a Lua, module: String) -> Result> { +fn lua_require(lua: &Lua, module: String) -> Result> { match module.as_str() { - "silo" => silo_module(&lua), - "log" => log_module(&lua), + "silo" => silo_module(lua), + "log" => log_module(lua), _ => { let old_require: mlua::Function = lua.globals().get("old_require")?; old_require.call(module) diff --git a/src/templating/helpers.rs b/src/templating/helpers.rs index d8c041e..4a6ea32 100644 --- a/src/templating/helpers.rs +++ b/src/templating/helpers.rs @@ -35,7 +35,6 @@ impl HelperDef for IfInstalledHelper { .ok_or_else(|| RenderErrorReason::BlockContentRequired)? .render(r, ctx, rc, out) .map_err(RenderError::from) - .into() } else { log::debug!("`{bin}` is not installed"); HelperResult::Ok(()) diff --git a/src/templating/mod.rs b/src/templating/mod.rs index 0f3d83a..68eb24d 100644 --- a/src/templating/mod.rs +++ b/src/templating/mod.rs @@ -32,7 +32,7 @@ pub fn context<'a, T: Serialize>(ctx: T) -> WrappedContext<'a, T> { lazy_static! { static ref CTX: ContextData = ContextData::default(); } - WrappedContext { data: &*CTX, ctx } + WrappedContext { data: &CTX, ctx } } #[derive(Serialize)]