From 5ff2166fa2bda867e650e9572bfdc105fedcb786 Mon Sep 17 00:00:00 2001 From: alemidev Date: Tue, 18 Oct 2022 02:28:16 +0200 Subject: [PATCH] chore: warnings be gone --- src/client/nvim/mod.rs | 2 +- src/server/actor/buffer.rs | 2 +- src/server/actor/state.rs | 2 +- src/server/actor/workspace.rs | 4 ++-- src/server/service/buffer.rs | 6 +++--- src/server/service/session.rs | 8 ++------ 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/client/nvim/mod.rs b/src/client/nvim/mod.rs index a176927..5db4a62 100644 --- a/src/client/nvim/mod.rs +++ b/src/client/nvim/mod.rs @@ -71,7 +71,7 @@ impl Handler for NeovimHandler { sink.lock().await.replace(tx); let _worker = tokio::spawn(async move { let mut col : i64; - let mut row : i64 = 0; + let mut row : i64; let ns = neovim.create_namespace("Cursor").await.unwrap(); while let Some(update) = rx.recv().await { neovim.exec_lua(format!("print('{:?}')", update).as_str(), vec![]).await.unwrap(); diff --git a/src/server/actor/buffer.rs b/src/server/actor/buffer.rs index 0538e4e..9e28b6d 100644 --- a/src/server/actor/buffer.rs +++ b/src/server/actor/buffer.rs @@ -33,7 +33,7 @@ impl Drop for Buffer { } impl Buffer { - pub fn new(name: String, bus: broadcast::Sender) -> Self { + pub fn new(name: String, _bus: broadcast::Sender) -> Self { let (op_tx, mut op_rx) = mpsc::channel(32); let (stop_tx, stop_rx) = watch::channel(true); let (content_tx, content_rx) = watch::channel(String::new()); diff --git a/src/server/actor/state.rs b/src/server/actor/state.rs index f8fbad8..a4b8dae 100644 --- a/src/server/actor/state.rs +++ b/src/server/actor/state.rs @@ -1,5 +1,5 @@ -use std::{collections::HashMap, sync::Arc, fmt::Display}; +use std::{collections::HashMap, sync::Arc}; use tokio::sync::{mpsc, watch}; use tracing::error; use uuid::Uuid; diff --git a/src/server/actor/workspace.rs b/src/server/actor/workspace.rs index c027139..df5a0a8 100644 --- a/src/server/actor/workspace.rs +++ b/src/server/actor/workspace.rs @@ -7,7 +7,7 @@ use library::{events::Event, user::{User, UserCursor}}; use crate::service::workspace::proto::CursorUpdate; -use super::{buffer::{BufferView, Buffer}}; +use super::buffer::{BufferView, Buffer}; #[derive(Debug, Clone)] pub struct UsersView { @@ -132,7 +132,7 @@ impl Workspace { } BufferAction::REMOVE { path } => { buffers.remove(&path); - bus.send(Event::BufferDelete { path: path }).unwrap(); + bus.send(Event::BufferDelete { path }).unwrap(); } } tx.send( diff --git a/src/server/service/buffer.rs b/src/server/service/buffer.rs index 70b7d3d..4d6f7a4 100644 --- a/src/server/service/buffer.rs +++ b/src/server/service/buffer.rs @@ -37,7 +37,7 @@ pub struct BufferService { fn op_seq(_o: &Operation) -> OperationSeq { todo!() } -fn op_net(_o: &OperationSeq) -> Operation { +fn _op_net(_o: &OperationSeq) -> Operation { todo!() } @@ -45,7 +45,7 @@ fn op_net(_o: &OperationSeq) -> Operation { async fn buffer_worker( bv: BufferView, mut client_rx: Streaming, - tx_client: mpsc::Sender>, + _tx_client: mpsc::Sender>, mut rx_core: broadcast::Receiver, ) { let mut queue: VecDeque = VecDeque::new(); @@ -67,7 +67,7 @@ async fn buffer_worker( }, server_op = rx_core.recv() => { - if let Ok(oop) = server_op { + if let Ok(_oop) = server_op { let mut send_op = true; for (i, _op) in queue.iter().enumerate() { if true { // TODO must compare underlying OperationSeq here! (op.equals(server_op)) diff --git a/src/server/service/session.rs b/src/server/service/session.rs index 3b92d77..c0aad35 100644 --- a/src/server/service/session.rs +++ b/src/server/service/session.rs @@ -4,7 +4,7 @@ pub mod proto { use std::sync::Arc; -use proto::{session_server::{Session}, WorkspaceBuilderRequest, SessionRequest, SessionResponse, WorkspaceList}; +use proto::{session_server::Session, WorkspaceBuilderRequest, SessionResponse}; use tonic::{Request, Response, Status}; @@ -14,10 +14,6 @@ use crate::actor::{ use self::proto::session_server::SessionServer; -use super::workspace::WorkspaceExtension; - -use uuid::Uuid; - #[derive(Debug)] pub struct SessionService { state: Arc, @@ -27,7 +23,7 @@ pub struct SessionService { impl Session for SessionService { async fn create_workspace( &self, - req: Request, + _req: Request, ) -> Result, Status> { // let name = req.extensions().get::().unwrap().id.clone(); let w = Workspace::new("im lazy".into());