Skip to content

Commit 2fe9c98

Browse files
committed
Fix build warning
1 parent ee6cdb0 commit 2fe9c98

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/rpchandler.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use super::*;
2+
use super::types::OptionDeref;
23
use crate::language_client::LanguageClient;
34
use crate::lsp::notification::Notification;
45
use crate::lsp::request::Request;
@@ -7,7 +8,7 @@ impl LanguageClient {
78
pub fn handle_call(&self, msg: Call) -> Fallible<()> {
89
match msg {
910
Call::MethodCall(lang_id, method_call) => {
10-
let result = self.handle_method_call(lang_id.as_deref(), &method_call);
11+
let result = self.handle_method_call(OptionDeref::as_deref(&lang_id), &method_call);
1112
if let Err(ref err) = result {
1213
if err.find_root_cause().downcast_ref::<LCError>().is_none() {
1314
error!(
@@ -22,7 +23,7 @@ impl LanguageClient {
2223
.output(method_call.id.to_int()?, result)?;
2324
}
2425
Call::Notification(lang_id, notification) => {
25-
let result = self.handle_notification(lang_id.as_deref(), &notification);
26+
let result = self.handle_notification(OptionDeref::as_deref(&lang_id), &notification);
2627
if let Err(ref err) = result {
2728
if err.downcast_ref::<LCError>().is_none() {
2829
error!(

src/vim.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use super::*;
2+
use super::types::OptionDeref;
23
use crate::rpcclient::RpcClient;
34
use crate::sign::Sign;
45
use crate::viewport::Viewport;
@@ -148,7 +149,7 @@ impl Vim {
148149

149150
pub fn edit(&self, goto_cmd: &Option<String>, path: impl AsRef<Path>) -> Fallible<()> {
150151
let path = path.as_ref().to_string_lossy();
151-
let goto = goto_cmd.as_deref().unwrap_or("edit");
152+
let goto = OptionDeref::as_deref(goto_cmd).unwrap_or("edit");
152153
self.rpcclient.notify("s:Edit", json!([goto, path]))?;
153154
Ok(())
154155
}

0 commit comments

Comments
 (0)