Skip to content

Commit 2cb1019

Browse files
committed
fix: unused
1 parent d5e3e79 commit 2cb1019

File tree

4 files changed

+4
-31
lines changed

4 files changed

+4
-31
lines changed

crates/pg_lsp/src/server.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ impl Server {
258258
let new_conn = DbConnection::new(connection_string.unwrap().as_str()).await;
259259

260260
if new_conn.is_err() {
261-
let err = new_conn.unwrap_err();
262261
return;
263262
}
264263

@@ -777,8 +776,6 @@ impl Server {
777776
return Ok(());
778777
}
779778

780-
let c = self.client.clone();
781-
782779
if let Some(response) = dispatch::RequestDispatcher::new(request)
783780
.on::<InlayHintRequest, _>(|id, params| self.inlay_hint(id, params))?
784781
.on::<HoverRequest, _>(|id, params| self.hover(id, params))?
@@ -855,7 +852,7 @@ impl Server {
855852

856853
sender.send(InternalMessage::SetOptions(options)).unwrap();
857854
}
858-
Err(why) => {
855+
Err(_why) => {
859856
// log::error!("Retrieving configuration failed: {}", why);
860857
}
861858
};
@@ -876,7 +873,7 @@ impl Server {
876873

877874
let client = self.client.clone();
878875
self.pool.execute(move || {
879-
if let Err(why) = client.send_request::<RegisterCapability>(params) {
876+
if let Err(_why) = client.send_request::<RegisterCapability>(params) {
880877
// log::error!(
881878
// "Failed to register \"{}\" notification: {}",
882879
// DidChangeConfiguration::METHOD,

crates/pg_lsp/src/server/debouncer/buffer.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,8 @@ pub trait Get: Sized {
2727
/// Attemtps to get the next element out of a buffer. If an element is
2828
/// [State::Ready] it's removed from the buffer.
2929
fn get(&mut self) -> State<Self::Data>;
30-
31-
/// Returns an iterator over all [State::Ready] elements of the buffer.
32-
/// Stops when either the next element is in [State::Wait] or the buffer
33-
/// is [State::Empty].
34-
fn iter(&mut self) -> BufferIter<Self> {
35-
BufferIter(self)
36-
}
3730
}
3831

39-
/// Wraps a mutable reference to a buffer and implements an [Iterator] returning
40-
/// elements in [State::Ready]. Commonly instantiated by [Get::iter()].
41-
pub struct BufferIter<'a, B: Get>(&'a mut B);
42-
43-
impl<'a, B: Get> Iterator for BufferIter<'a, B> {
44-
type Item = B::Data;
45-
46-
fn next(&mut self) -> Option<Self::Item> {
47-
match self.0.get() {
48-
State::Ready(data) => Some(data),
49-
_ => None,
50-
}
51-
}
52-
}
5332
/// Debouncing buffer with a common delay for all events. Accepts events via
5433
/// [EventBuffer::put()] which tracks the time of events and de-duplicates them
5534
/// against the current buffer content. Subsequent call to [EventBuffer::get

crates/pg_lsp/src/server/dispatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl NotificationDispatcher {
1717
N::Params: DeserializeOwned,
1818
F: FnOnce(N::Params) -> Result<()>,
1919
{
20-
if let Some(not) = self.not {
20+
if let Some(_not) = self.not {
2121
match not.extract::<N::Params>(N::METHOD) {
2222
Ok(params) => {
2323
handler(params)?;

crates/pg_lsp/src/utils/from_proto.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ pub fn content_changes(
1818
.collect()
1919
}
2020

21-
pub fn client_flags(
22-
capabilities: lsp_types::ClientCapabilities,
23-
info: Option<lsp_types::ClientInfo>,
24-
) -> ClientFlags {
21+
pub fn client_flags(capabilities: lsp_types::ClientCapabilities) -> ClientFlags {
2522
let configuration_pull = capabilities
2623
.workspace
2724
.as_ref()

0 commit comments

Comments
 (0)