mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 13:40:15 +03:00
remove clones
This commit is contained in:
@@ -162,7 +162,7 @@ pub fn limit(&mut self, limit: usize) {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Debug)]
|
||||
pub struct Analysis {
|
||||
imp: AnalysisImpl
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ pub fn handle_code_action(
|
||||
}
|
||||
|
||||
pub fn publish_diagnostics(
|
||||
world: ServerWorld,
|
||||
world: &ServerWorld,
|
||||
file_id: FileId,
|
||||
) -> Result<req::PublishDiagnosticsParams> {
|
||||
let uri = world.file_id_to_uri(file_id)?;
|
||||
@@ -497,7 +497,7 @@ pub fn publish_diagnostics(
|
||||
}
|
||||
|
||||
pub fn publish_decorations(
|
||||
world: ServerWorld,
|
||||
world: &ServerWorld,
|
||||
file_id: FileId,
|
||||
) -> Result<req::PublishDecorationsParams> {
|
||||
let uri = world.file_id_to_uri(file_id)?;
|
||||
|
||||
@@ -391,7 +391,7 @@ fn update_file_notifications_on_threadpool(
|
||||
) {
|
||||
pool.spawn(move || {
|
||||
for file_id in subscriptions {
|
||||
match handlers::publish_diagnostics(world.clone(), file_id) {
|
||||
match handlers::publish_diagnostics(&world, file_id) {
|
||||
Err(e) => {
|
||||
error!("failed to compute diagnostics: {:?}", e)
|
||||
}
|
||||
@@ -400,7 +400,7 @@ fn update_file_notifications_on_threadpool(
|
||||
sender.send(Task::Notify(not));
|
||||
}
|
||||
}
|
||||
match handlers::publish_decorations(world.clone(), file_id) {
|
||||
match handlers::publish_decorations(&world, file_id) {
|
||||
Err(e) => {
|
||||
error!("failed to compute decorations: {:?}", e)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ pub struct ServerWorldState {
|
||||
pub mem_map: FxHashMap<FileId, Option<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ServerWorld {
|
||||
pub workspaces: Arc<Vec<CargoWorkspace>>,
|
||||
pub analysis: Analysis,
|
||||
|
||||
Reference in New Issue
Block a user