Some clippy fixes for 1.36

This commit is contained in:
Jeremy Kolb 2019-07-04 13:26:44 -04:00
parent c6a6e43372
commit 4ad9e986ad
31 changed files with 62 additions and 70 deletions

View file

@ -171,7 +171,7 @@ impl Conv for ra_ide_api::Documentation {
fn conv(self) -> Documentation {
Documentation::MarkupContent(MarkupContent {
kind: MarkupKind::Markdown,
value: crate::markdown::mark_fenced_blocks_as_rust(self.as_str()).into(),
value: crate::markdown::mark_fenced_blocks_as_rust(self.as_str()),
})
}
}

View file

@ -5,9 +5,7 @@ pub(crate) mod pending_requests;
use std::{error::Error, fmt, path::PathBuf, sync::Arc, time::Instant};
use crossbeam_channel::{select, unbounded, Receiver, RecvError, Sender};
use gen_lsp_server::{
handle_shutdown, ErrorCode, RawMessage, RawNotification, RawRequest, RawResponse,
};
use gen_lsp_server::{handle_shutdown, ErrorCode, RawMessage, RawNotification, RawRequest, RawResponse};
use lsp_types::NumberOrString;
use ra_ide_api::{Canceled, FileId, LibraryData};
use ra_prof::profile;
@ -398,7 +396,8 @@ fn on_notification(
Ok(mut params) => {
let uri = params.text_document.uri;
let path = uri.to_file_path().map_err(|()| format!("invalid uri: {}", uri))?;
let text = params.content_changes.pop().ok_or_else(|| format!("empty changes"))?.text;
let text =
params.content_changes.pop().ok_or_else(|| "empty changes".to_string())?.text;
state.vfs.write().change_file_overlay(path.as_path(), text);
return Ok(());
}