Replace qualified miette with use
change lozmnvnpwtyrrwoluykttooltsqxsyru
commit 177ab6e4eced939c6ca4056982373c771ee04602
author Alpha Chen <alpha@kejadlen.dev>
date
parent xtlvtrsp
diff --git a/src/bin/quire/commands/exec.rs b/src/bin/quire/commands/exec.rs
index 59f8f9e..39bf311 100644
--- a/src/bin/quire/commands/exec.rs
+++ b/src/bin/quire/commands/exec.rs
@@ -1,7 +1,7 @@
 use std::os::unix::process::CommandExt;
 use std::process::Command;
 
-use miette::{Context, IntoDiagnostic, Result, bail, ensure};
+use miette::{Context, IntoDiagnostic, Result, bail, ensure, miette};
 
 use quire::Quire;
 
@@ -52,7 +52,7 @@ fn dispatch_git(quire: &Quire, git_cmd: &str, args: &[String]) -> Result<()> {
     // binary handles dispatch to libexec/git-core/ internally.
     let subcommand = git_cmd
         .strip_prefix("git-")
-        .ok_or_else(|| miette::miette!("unexpected git command: {git_cmd}"))?;
+        .ok_or_else(|| miette!("unexpected git command: {git_cmd}"))?;
     let err = Command::new("git")
         .arg(subcommand)
         .arg(".")
diff --git a/src/error.rs b/src/error.rs
index c930e2f..cc06d7c 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,4 +1,6 @@
-#[derive(Debug, thiserror::Error, miette::Diagnostic)]
+use miette::Diagnostic;
+
+#[derive(Debug, thiserror::Error, Diagnostic)]
 pub enum Error {
     #[error("not found: {0}")]
     NotFound(String),
diff --git a/src/fennel.rs b/src/fennel.rs
index a14d346..ecc6153 100644
--- a/src/fennel.rs
+++ b/src/fennel.rs
@@ -1,12 +1,12 @@
 use std::path::Path;
 
-use miette::{Result, SourceOffset};
+use miette::{Diagnostic, Result, SourceOffset};
 use mlua::{Lua, LuaSerdeExt};
 
 const FENNEL_LUA: &str = include_str!("../vendor/fennel.lua");
 
 /// Error kinds from the Fennel loader.
-#[derive(Debug, thiserror::Error, miette::Diagnostic)]
+#[derive(Debug, thiserror::Error, Diagnostic)]
 pub enum FennelError {
     #[error("file not found: {0}")]
     FileNotFound(String),
diff --git a/src/quire.rs b/src/quire.rs
index 78a589e..4348585 100644
--- a/src/quire.rs
+++ b/src/quire.rs
@@ -1,6 +1,6 @@
 use std::path::{Path, PathBuf};
 
-use miette::{IntoDiagnostic, Result, ensure};
+use miette::{IntoDiagnostic, Result, ensure, miette};
 
 use crate::fennel::Fennel;
 use crate::secret::SecretString;
@@ -219,9 +219,9 @@ impl Quire {
     /// `.git` suffix. Used by hooks that receive `GIT_DIR` from git.
     pub fn repo_from_path(&self, path: &Path) -> Result<Repo> {
         let resolved = self.repos_dir();
-        let relative = path.strip_prefix(&resolved).map_err(|_| {
-            miette::miette!("path is not under repos directory: {}", path.display())
-        })?;
+        let relative = path
+            .strip_prefix(&resolved)
+            .map_err(|_| miette!("path is not under repos directory: {}", path.display()))?;
         let name = relative.to_string_lossy();
         validate_repo_name(&name)?;
         Ok(Repo {