diff --git a/src/server/forge/forgejo/mod.rs b/src/server/forge/forgejo/mod.rs index add8eff..b79840a 100644 --- a/src/server/forge/forgejo/mod.rs +++ b/src/server/forge/forgejo/mod.rs @@ -1,5 +1,4 @@ use kxio::network; -use terrors::OneOf; use tracing::{error, info, warn}; use crate::server; @@ -13,7 +12,7 @@ pub async fn get_commit_histories( repo_details: &server::config::RepoDetails, config: &server::config::RepoConfig, net: &kxio::network::Network, -) -> Result> { +) -> Result { let main = (get_commit_history(repo_details, &config.branches().main(), vec![], net).await)?; let main_head = main[0].clone(); let next = (get_commit_history( @@ -47,7 +46,7 @@ async fn get_commit_history( branch_name: &BranchName, find_commits: Vec, net: &kxio::network::Network, -) -> Result, OneOf<(network::NetworkError,)>> { +) -> Result, network::NetworkError> { let hostname = &repo_details.forge.hostname; let path = &repo_details.repo; let token = &repo_details.forge.token; @@ -72,11 +71,7 @@ async fn get_commit_history( None, network::NetRequestLogging::None, ); - let result = net.get::>(request).await; - let response = result.map_err(|e| { - error!(?e, "Failed to get commit history"); - OneOf::new(e) - })?; + let response = net.get::>(request).await?; let commits = response .response_body() .unwrap_or_default() diff --git a/src/server/forge/mod.rs b/src/server/forge/mod.rs index 050d1a1..0826b7a 100644 --- a/src/server/forge/mod.rs +++ b/src/server/forge/mod.rs @@ -2,6 +2,9 @@ use std::fmt::{Display, Formatter}; pub mod forgejo; +#[cfg(test)] +mod tests; + #[derive(Clone, Debug)] pub struct CommitHistories { pub main: Vec, diff --git a/src/server/forge/tests.rs b/src/server/forge/tests.rs new file mode 100644 index 0000000..bd81536 --- /dev/null +++ b/src/server/forge/tests.rs @@ -0,0 +1,10 @@ +use kxio::network::NetworkError; + +use crate::server::forge::CommitHistories; + +#[test] +const fn test_is_send() { + const fn assert_send() {} + assert_send::(); + assert_send::(); +}