Skip to content

Commit bffb888

Browse files
lsp-server: Fix warnings about clippy str_to_string rule
1 parent c3699b9 commit bffb888

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/lsp-server/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,12 @@ impl Connection {
360360
}
361361
Err(RecvTimeoutError::Timeout) => {
362362
return Err(ProtocolError::new(
363-
"timed out waiting for exit notification".to_string(),
363+
"timed out waiting for exit notification".to_owned(),
364364
))
365365
}
366366
Err(RecvTimeoutError::Disconnected) => {
367367
return Err(ProtocolError::new(
368-
"channel disconnected waiting for exit notification".to_string(),
368+
"channel disconnected waiting for exit notification".to_owned(),
369369
))
370370
}
371371
}
@@ -406,15 +406,15 @@ mod tests {
406406
#[test]
407407
fn not_exit_notification() {
408408
let notification = crate::Notification {
409-
method: Initialized::METHOD.to_string(),
409+
method: Initialized::METHOD.to_owned(),
410410
params: to_value(InitializedParams {}).unwrap(),
411411
};
412412

413413
let params_as_value = to_value(InitializeParams::default()).unwrap();
414414
let req_id = RequestId::from(234);
415415
let request = crate::Request {
416416
id: req_id.clone(),
417-
method: Initialize::METHOD.to_string(),
417+
method: Initialize::METHOD.to_owned(),
418418
params: params_as_value.clone(),
419419
};
420420

@@ -427,7 +427,7 @@ mod tests {
427427
#[test]
428428
fn exit_notification() {
429429
let notification =
430-
crate::Notification { method: Exit::METHOD.to_string(), params: to_value(()).unwrap() };
430+
crate::Notification { method: Exit::METHOD.to_owned(), params: to_value(()).unwrap() };
431431
let notification_msg = Message::from(notification);
432432

433433
initialize_start_test(TestCase {

lib/lsp-server/src/msg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn read_msg_text(inp: &mut dyn BufRead) -> io::Result<Option<String>> {
269269
size = Some(header_value.parse::<usize>().map_err(invalid_data)?);
270270
}
271271
}
272-
let size: usize = size.ok_or_else(|| invalid_data("no Content-Length".to_string()))?;
272+
let size: usize = size.ok_or_else(|| invalid_data("no Content-Length".to_owned()))?;
273273
let mut buf = buf.into_bytes();
274274
buf.resize(size, 0);
275275
inp.read_exact(&mut buf)?;

lib/lsp-server/src/req_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<I> Incoming<I> {
4040
let _data = self.complete(id.clone())?;
4141
let error = ResponseError {
4242
code: ErrorCode::RequestCanceled as i32,
43-
message: "canceled by client".to_string(),
43+
message: "canceled by client".to_owned(),
4444
data: None,
4545
};
4646
Some(Response { id, result: None, error: Some(error) })

0 commit comments

Comments
 (0)