diff --git a/src/backend/git.rs b/src/backend/git.rs index a2d5899..9d3b65d 100644 --- a/src/backend/git.rs +++ b/src/backend/git.rs @@ -14,7 +14,7 @@ use crate::model::repository::{ use crate::model::user::User; use crate::{ messages::repository::{ - CreateRepositoryRequest, CreateRepositoryResponse, RepositoryFileInspectRequest, + CreateRepositoryRequest, RepositoryCreateResponse, RepositoryFileInspectRequest, RepositoryFileInspectionResponse, RepositoryInfoRequest, RepositoryIssueLabelsRequest, RepositoryIssueLabelsResponse, RepositoryIssuesCountRequest, RepositoryIssuesCountResponse, RepositoryIssuesRequest, RepositoryIssuesResponse, @@ -212,7 +212,7 @@ impl RepositoryBackend for GitBackend { &mut self, _user: &User, request: &CreateRepositoryRequest, - ) -> Result { + ) -> Result { // Check if repository already exists in the database if let Ok(repository) = self .find_by_owner_user_name(&request.owner, &request.name) @@ -224,7 +224,7 @@ impl RepositoryBackend for GitBackend { }; error!("{:?}", err); - return Ok(CreateRepositoryResponse::Failed); + return Ok(RepositoryCreateResponse::Failed); } // Insert the repository into the database @@ -238,7 +238,7 @@ impl RepositoryBackend for GitBackend { let err = GitBackendError::FailedInsertingIntoDatabase(err); error!("Failed inserting into the database! {:?}", err); - return Ok(CreateRepositoryResponse::Failed); + return Ok(RepositoryCreateResponse::Failed); } }; @@ -255,7 +255,7 @@ impl RepositoryBackend for GitBackend { "Created new repository with the name {}/{}/{}", request.owner.instance.url, request.owner.username, request.name ); - Ok(CreateRepositoryResponse::Created) + Ok(RepositoryCreateResponse::Created) } Err(err) => { let err = GitBackendError::FailedCreatingRepository(err); @@ -270,7 +270,7 @@ impl RepositoryBackend for GitBackend { } // ??? - Ok(CreateRepositoryResponse::Failed) + Ok(RepositoryCreateResponse::Failed) //Err(Box::new(err)) } } diff --git a/src/backend/mod.rs b/src/backend/mod.rs index dd6efae..19344ff 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -13,7 +13,7 @@ use crate::{ RegisterAccountResponse, }, repository::{ - CreateRepositoryRequest, CreateRepositoryResponse, RepositoryFileInspectRequest, + CreateRepositoryRequest, RepositoryCreateResponse, RepositoryFileInspectRequest, RepositoryFileInspectionResponse, RepositoryInfoRequest, RepositoryIssueLabelsRequest, RepositoryIssueLabelsResponse, RepositoryIssuesCountRequest, RepositoryIssuesCountResponse, RepositoryIssuesRequest, RepositoryIssuesResponse, @@ -35,7 +35,7 @@ pub trait RepositoryBackend: IssuesBackend { &mut self, user: &User, request: &CreateRepositoryRequest, - ) -> Result; + ) -> Result; async fn repository_info( &mut self, requester: Option<&User>, diff --git a/src/messages/repository.rs b/src/messages/repository.rs index 82fd3bc..6f054d9 100644 --- a/src/messages/repository.rs +++ b/src/messages/repository.rs @@ -29,7 +29,7 @@ pub struct CreateRepositoryRequest { } #[derive(Clone, Serialize, Deserialize)] -pub enum CreateRepositoryResponse { +pub enum RepositoryCreateResponse { Created, Failed, }