diff --git a/src/backend/git.rs b/src/backend/git.rs index 48e1afb..f028a3e 100644 --- a/src/backend/git.rs +++ b/src/backend/git.rs @@ -23,21 +23,21 @@ impl GitBackend { impl RepositoryBackend for GitBackend { fn create_repository( &mut self, - request: &CreateRepositoryRequest, + _request: &CreateRepositoryRequest, ) -> Result> { todo!() } fn repository_info( &mut self, - request: &RepositoryInfoRequest, + _request: &RepositoryInfoRequest, ) -> Result> { todo!() } fn repository_file_inspect( &mut self, - request: &RepositoryFileInspectRequest, + _request: &RepositoryFileInspectRequest, ) -> Result> { todo!() } @@ -46,21 +46,21 @@ impl RepositoryBackend for GitBackend { impl IssuesBackend for GitBackend { fn issues_count( &mut self, - request: &RepositoryIssuesCountRequest, + _request: &RepositoryIssuesCountRequest, ) -> Result> { todo!() } fn issue_labels( &mut self, - request: &RepositoryIssueLabelsRequest, + _request: &RepositoryIssueLabelsRequest, ) -> Result> { todo!() } fn issues( &mut self, - request: &RepositoryIssuesRequest, + _request: &RepositoryIssuesRequest, ) -> Result> { todo!() } diff --git a/src/connection.rs b/src/connection.rs index 49f03d3..a16735f 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -1,8 +1,7 @@ use std::{collections::HashMap, net::SocketAddr, sync::Arc}; -use futures_util::{stream::StreamExt, SinkExt, TryStreamExt}; +use futures_util::{stream::StreamExt, SinkExt}; use tokio::{ - io::{AsyncRead, AsyncWrite}, net::TcpStream, sync::{ broadcast::{Receiver, Sender}, @@ -14,20 +13,17 @@ use tokio_tungstenite::{tungstenite::Message, WebSocketStream}; use crate::{ backend::{IssuesBackend, RepositoryBackend}, - handshake::{HandshakeFinalize, HandshakeMessage, HandshakeResponse, InitiateHandshake}, + handshake::{HandshakeFinalize, HandshakeMessage, HandshakeResponse}, listener::Listeners, messages::{ - issues::IssuesCountResponse, repository::{ - RepositoryFileInspectionResponse, RepositoryIssueLabelsResponse, - RepositoryIssuesResponse, RepositoryMessage, RepositoryMessageKind, RepositoryRequest, - RepositoryResponse, + RepositoryMessage, RepositoryMessageKind, RepositoryRequest, RepositoryResponse, }, MessageKind, }, model::{ instance::{Instance, InstanceMeta}, - repository::{CommitMetadata, Repository, RepositoryView}, + repository::Repository, user::User, }, }; @@ -56,7 +52,7 @@ pub struct Connections { pub async fn connection_worker( mut socket: WebSocketStream, listeners: Arc>, - mut connections: Arc>, + connections: Arc>, backend: Arc>, addr: SocketAddr, ) { @@ -355,7 +351,7 @@ pub async fn connection_worker( .unwrap(); } }, - RepositoryMessageKind::Response(response) => { + RepositoryMessageKind::Response(_response) => { unreachable!() } } @@ -369,7 +365,7 @@ pub async fn connection_worker( async fn send_and_get_listener( message: MessageKind, listeners: &Arc>, - mut connections: &Arc>, + connections: &Arc>, ) -> Receiver { let (instance, user, repository): (Option, Option, Option) = match &message { @@ -387,7 +383,7 @@ async fn send_and_get_listener( }; let mut listeners = listeners.lock().await; - let mut listener = listeners.add(instance, user, repository); + let listener = listeners.add(instance, user, repository); drop(listeners); let connections = connections.lock().await; diff --git a/src/listener.rs b/src/listener.rs index b4a1956..4fd1954 100644 --- a/src/listener.rs +++ b/src/listener.rs @@ -15,9 +15,9 @@ pub struct Listeners { impl Listeners { pub fn add( &mut self, - instance: Option, - user: Option, - repository: Option, + _instance: Option, + _user: Option, + _repository: Option, ) -> Receiver { todo!() } diff --git a/src/main.rs b/src/main.rs index 29eeeb5..b3cd9c8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::{error::Error, net::SocketAddr, sync::Arc}; -use connection::{connection_worker, Connections, RawConnection, UnestablishedConnection}; +use connection::{connection_worker, Connections, RawConnection}; use giterated_daemon::{ backend::{git::GitBackend, RepositoryBackend}, connection, listener, @@ -20,10 +20,9 @@ extern crate tracing; async fn main() -> Result<(), Box> { tracing_subscriber::fmt::init(); let mut listener = TcpListener::bind("127.0.0.1:8080").await?; - let mut connections: Arc> = Arc::default(); - let mut listeners: Arc> = Arc::default(); - let mut backend: Arc> = - Arc::new(Mutex::new(GitBackend::new())); + let connections: Arc> = Arc::default(); + let listeners: Arc> = Arc::default(); + let backend: Arc> = Arc::new(Mutex::new(GitBackend::new())); loop { let stream = accept_stream(&mut listener).await; diff --git a/src/messages/repository.rs b/src/messages/repository.rs index 0db8eba..68a8e50 100644 --- a/src/messages/repository.rs +++ b/src/messages/repository.rs @@ -5,8 +5,6 @@ use crate::model::{ user::User, }; -use super::issues::IssuesCountResponse; - #[derive(Clone, Serialize, Deserialize)] pub struct RepositoryMessage { pub target: Repository, diff --git a/src/model/repository.rs b/src/model/repository.rs index fc6a3b4..ae1c4d8 100644 --- a/src/model/repository.rs +++ b/src/model/repository.rs @@ -1,5 +1,3 @@ -use std::time::Instant; - use serde::{Deserialize, Serialize}; use super::instance::Instance;