diff --git a/giterated-daemon/src/backend/git.rs b/giterated-daemon/src/backend/git.rs index b5ff7c8..165c822 100644 --- a/giterated-daemon/src/backend/git.rs +++ b/giterated-daemon/src/backend/git.rs @@ -1,6 +1,5 @@ use anyhow::Error; use async_trait::async_trait; -use futures_util::StreamExt; use git2::BranchType; use giterated_models::instance::{Instance, RepositoryCreateRequest}; @@ -839,6 +838,7 @@ impl IssuesBackend for GitBackend { } } +#[allow(unused)] #[derive(Debug, sqlx::FromRow)] struct RepositoryMetadata { pub repository: String, diff --git a/giterated-daemon/src/backend/user.rs b/giterated-daemon/src/backend/user.rs index 98af009..c294e83 100644 --- a/giterated-daemon/src/backend/user.rs +++ b/giterated-daemon/src/backend/user.rs @@ -257,6 +257,7 @@ struct UserRow { pub enc_private_key: Vec, } +#[allow(unused)] #[derive(Debug, sqlx::FromRow)] struct UserValue { pub username: String, diff --git a/giterated-daemon/src/database_backend/mod.rs b/giterated-daemon/src/database_backend/mod.rs index 9c8d8a5..1914c54 100644 --- a/giterated-daemon/src/database_backend/mod.rs +++ b/giterated-daemon/src/database_backend/mod.rs @@ -106,10 +106,13 @@ impl ObjectBackend for DatabaseBackend { .map_err(|e| OperationError::Internal(e.to_string()))?), Err(err) => match err { OperationError::Internal(internal) => { - warn!("Internal Error: {:?}", OperationError::<()>::Internal(internal.clone())); - + warn!( + "Internal Error: {:?}", + OperationError::<()>::Internal(internal.clone()) + ); + Err(OperationError::Internal(internal)) - }, + } OperationError::Unhandled => Err(OperationError::Unhandled), OperationError::Operation(err) => Err(OperationError::Operation( serde_json::from_slice(&err) @@ -142,10 +145,13 @@ impl ObjectBackend for DatabaseBackend { .map_err(|e| OperationError::Internal(e.to_string()))?), Err(err) => match err { OperationError::Internal(internal) => { - warn!("Internal Error: {:?}", OperationError::<()>::Internal(internal.clone())); + warn!( + "Internal Error: {:?}", + OperationError::<()>::Internal(internal.clone()) + ); Err(OperationError::Internal(internal)) - }, + } OperationError::Unhandled => Err(OperationError::Unhandled), OperationError::Operation(err) => Err(OperationError::Operation( serde_json::from_slice(&err) @@ -178,10 +184,13 @@ impl ObjectBackend for DatabaseBackend { .map_err(|e| OperationError::Internal(e.to_string()))?), Err(err) => match err { OperationError::Internal(internal) => { - warn!("Internal Error: {:?}", OperationError::<()>::Internal(internal.clone())); - - Err(OperationError::Internal(internal)) - } + warn!( + "Internal Error: {:?}", + OperationError::<()>::Internal(internal.clone()) + ); + + Err(OperationError::Internal(internal)) + } OperationError::Unhandled => Err(OperationError::Unhandled), OperationError::Operation(err) => Err(OperationError::Operation( serde_json::from_slice(&err) @@ -312,8 +321,8 @@ mod test { } async fn repositories_for_user( &mut self, - requester: Option<&User>, - user: &User, + _requester: Option<&User>, + _user: &User, ) -> Result, Error> { todo!() } @@ -350,33 +359,33 @@ mod test { } async fn repository_file_inspect( &mut self, - requester: Option<&User>, - repository: &Repository, - request: &RepositoryFileInspectRequest, + _requester: Option<&User>, + _repository: &Repository, + _request: &RepositoryFileInspectRequest, ) -> Result, Error> { todo!() } async fn repository_file_from_id( &mut self, - requester: Option<&User>, - repository: &Repository, - request: &RepositoryFileFromIdRequest, + _requester: Option<&User>, + _repository: &Repository, + _request: &RepositoryFileFromIdRequest, ) -> Result { todo!() } async fn repository_diff( &mut self, - requester: Option<&User>, - repository: &Repository, - request: &RepositoryDiffRequest, + _requester: Option<&User>, + _repository: &Repository, + _request: &RepositoryDiffRequest, ) -> Result { todo!() } async fn repository_commit_before( &mut self, - requester: Option<&User>, - repository: &Repository, - request: &RepositoryCommitBeforeRequest, + _requester: Option<&User>, + _repository: &Repository, + _request: &RepositoryCommitBeforeRequest, ) -> Result { todo!() } diff --git a/giterated-models/src/message.rs b/giterated-models/src/message.rs index e176094..cb04778 100644 --- a/giterated-models/src/message.rs +++ b/giterated-models/src/message.rs @@ -15,6 +15,7 @@ pub struct GiteratedMessage> { pub payload: V, } +#[allow(unused)] mod string { use std::fmt::Display; use std::str::FromStr; diff --git a/giterated-models/src/repository/operations.rs b/giterated-models/src/repository/operations.rs index 17f0907..112637b 100644 --- a/giterated-models/src/repository/operations.rs +++ b/giterated-models/src/repository/operations.rs @@ -7,7 +7,10 @@ use crate::{ operation::GiteratedOperation, }; -use super::{IssueLabel, Repository, RepositoryIssue, RepositoryTreeEntry, RepositoryView, RepositoryFile, RepositoryDiff, Commit}; +use super::{ + Commit, IssueLabel, Repository, RepositoryDiff, RepositoryFile, RepositoryIssue, + RepositoryTreeEntry, RepositoryView, +}; /// A request to get a repository's information. /// @@ -164,12 +167,13 @@ impl Object<'_, Repository, B> { }) .await } - + pub async fn file_from_id( &mut self, id: String, ) -> Result> { - self.request::(RepositoryFileFromIdRequest(id)).await + self.request::(RepositoryFileFromIdRequest(id)) + .await } pub async fn diff( @@ -177,14 +181,16 @@ impl Object<'_, Repository, B> { old_id: String, new_id: String, ) -> Result> { - self.request::(RepositoryDiffRequest { old_id, new_id }).await + self.request::(RepositoryDiffRequest { old_id, new_id }) + .await } pub async fn commit_before( &mut self, id: String, ) -> Result> { - self.request::(RepositoryCommitBeforeRequest(id)).await + self.request::(RepositoryCommitBeforeRequest(id)) + .await } // pub async fn issues_count(&mut self) -> Result> {