chore: remove dependency on terrors
All checks were successful
Rust / build (push) Successful in 1m15s
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful

This commit is contained in:
Paul Campbell 2024-05-18 22:16:17 +01:00
parent 85d38ede56
commit f56ac321f4
5 changed files with 9 additions and 17 deletions

View file

@ -66,9 +66,6 @@ derive_more = { version = "1.0.0-beta.6", features = [
"from",
] }
# error handling
terrors = "0.3"
# file watcher
inotify = "0.10"

View file

@ -46,7 +46,6 @@ secrecy = { workspace = true }
#
# # error handling
derive_more = { workspace = true }
# terrors = { workspace = true }
#
# # file watcher
# inotify = { workspace = true }

View file

@ -48,7 +48,6 @@ secrecy = { workspace = true }
# error handling
derive_more = { workspace = true }
# terrors = { workspace = true }
# # file watcher
# inotify = { workspace = true }

View file

@ -47,9 +47,8 @@ bytes = { workspace = true }
ulid = { workspace = true }
warp = { workspace = true }
# error handling
# boilerplate
derive_more = { workspace = true }
terrors = { workspace = true }
# file watcher
inotify = { workspace = true }

View file

@ -1,25 +1,23 @@
use git_next_config::{BranchName, RepoConfig};
use git_next_git::RepoDetails;
use terrors::OneOf;
use tracing::error;
use crate::gitforge::{self, ForgeFileError};
pub async fn load(
details: &RepoDetails,
forge: &gitforge::Forge,
) -> Result<RepoConfig, OneOf<(ForgeFileError, crate::config::Error, toml::de::Error, Error)>> {
pub async fn load(details: &RepoDetails, forge: &gitforge::Forge) -> Result<RepoConfig, Error> {
let contents = forge
.file_contents_get(&details.branch, ".git-next.toml")
.await
.map_err(OneOf::new)?;
let config = RepoConfig::load(&contents).map_err(OneOf::new)?;
let config = validate(config, forge).await.map_err(OneOf::new)?;
.await?;
let config = RepoConfig::load(&contents)?;
let config = validate(config, forge).await?;
Ok(config)
}
#[derive(Debug)]
#[derive(Debug, derive_more::From, derive_more::Display)]
pub enum Error {
File(ForgeFileError),
Config(crate::config::Error),
Toml(toml::de::Error),
Forge(gitforge::ForgeBranchError),
BranchNotFound(BranchName),
}