mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Clippy fixes
This commit is contained in:
parent
a12ccd5923
commit
717ba1d56a
3 changed files with 7 additions and 7 deletions
|
@ -68,8 +68,8 @@ impl FileChange {
|
|||
let source_root = db.source_root(source_root_id);
|
||||
let durability = durability(&source_root);
|
||||
// XXX: can't actually remove the file, just reset the text
|
||||
let text = text.as_ref().map(String::as_str).unwrap_or_else(|| "");
|
||||
db.set_file_text_with_durability(file_id, text, durability)
|
||||
let text = text.unwrap_or_default();
|
||||
db.set_file_text_with_durability(file_id, &text, durability)
|
||||
}
|
||||
if let Some(crate_graph) = self.crate_graph {
|
||||
db.set_crate_graph_with_durability(Arc::new(crate_graph), Durability::HIGH);
|
||||
|
|
|
@ -135,7 +135,7 @@ impl<Db: ?Sized + SourceDatabaseExt> SourceDatabaseExt2 for Db {
|
|||
durability: Durability,
|
||||
) {
|
||||
let bytes = text.as_bytes();
|
||||
let compressed = lz4_flex::compress_prepend_size(&bytes);
|
||||
let compressed = lz4_flex::compress_prepend_size(bytes);
|
||||
self.set_compressed_file_text_with_durability(
|
||||
file_id,
|
||||
Arc::from(compressed.as_slice()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue