From ef9880a5b0e7af2946a77ea76185b73e08a190b4 Mon Sep 17 00:00:00 2001 From: Nilirad Date: Tue, 8 Sep 2026 14:27:59 +0200 Subject: [PATCH] Remove unused code, update docs, and uniformize module file structure --- README.md | 4 ++-- src/http/{handler.rs => handler/mod.rs} | 0 src/{http.rs => http/mod.rs} | 0 src/polling/error.rs | 17 ----------------- src/trigger/error.rs | 4 ---- 5 files changed, 2 insertions(+), 23 deletions(-) rename src/http/{handler.rs => handler/mod.rs} (100%) rename src/{http.rs => http/mod.rs} (100%) diff --git a/README.md b/README.md index cf0a573..8cd48b6 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,13 @@ and the repositories that need those dependencies. This project uses [`axum`] to handle incoming requests, [`reqwest`] to send requests to the GitHub API, -[`git ls-remote`] to check the last commit on a remote branch, +[`gix`] to check the latest commit on remote branches, and [`sqlx`] connected to a SQLite database to hold state. [`axum`]: https://docs.rs/axum/latest/axum/ [`reqwest`]: https://docs.rs/reqwest/latest/reqwest/ -[`git ls-remote`]: https://git-scm.com/docs/git-ls-remote +[`gix`]: https://docs.rs/gix/latest/gix/ [`sqlx`]: https://docs.rs/sqlx/latest/sqlx/ ## Usage diff --git a/src/http/handler.rs b/src/http/handler/mod.rs similarity index 100% rename from src/http/handler.rs rename to src/http/handler/mod.rs diff --git a/src/http.rs b/src/http/mod.rs similarity index 100% rename from src/http.rs rename to src/http/mod.rs diff --git a/src/polling/error.rs b/src/polling/error.rs index 039f276..dba1340 100644 --- a/src/polling/error.rs +++ b/src/polling/error.rs @@ -73,27 +73,10 @@ pub enum CommitHashError { #[error("Validation error: {0}")] Validation(#[from] ValidationError), - /// I/O error. - #[error("I/O error: {0}")] - Io(#[from] std::io::Error), - /// Unexpected failure while fetching the commit hash. #[error("Unexpected failure while fetching the commit hash: {0}")] UnexpectedStatus(String), - /// Unexpected output while fetching the commit hash. - #[error( - "Unexpected output while fetching the commit hash. Repo: {repo_url}; Branch: {branch}; Output: {stdout}" - )] - UnexpectedOutput { - /// The unexpected output text. - stdout: String, - /// The relevant git repository URL. - repo_url: String, - /// The relevant git branch. - branch: String, - }, - /// Failed to find remote. #[error("Failed to find remote: {0}")] // Error is boxed because it is very large diff --git a/src/trigger/error.rs b/src/trigger/error.rs index 2f5240d..07daf18 100644 --- a/src/trigger/error.rs +++ b/src/trigger/error.rs @@ -31,10 +31,6 @@ impl From for WorkflowTriggerError { /// Authentication errors. #[derive(Debug, Error)] pub enum AuthError { - /// Failed to read PEM file. - #[error("Could not read PEM file: {0}")] - PemFile(#[from] std::io::Error), - /// An error with time APIs. #[error("System time: {0}")] Time(#[from] std::time::SystemTimeError),