Skip to content

Commit df00da1

Browse files
committed
Fix compilation
1 parent aee22c7 commit df00da1

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

crates/ra_assists/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ mod doc_tests;
1717
pub mod utils;
1818
pub mod ast_transform;
1919

20+
use hir::Semantics;
2021
use ra_db::{FileId, FileRange};
2122
use ra_ide_db::RootDatabase;
2223
use ra_syntax::{TextRange, TextSize};
2324
use ra_text_edit::TextEdit;
2425

2526
pub(crate) use crate::assist_ctx::{Assist, AssistCtx, AssistHandler};
26-
use hir::Semantics;
2727

2828
/// Unique identifier of the assist, should not be shown to the user
2929
/// directly.

crates/ra_ide/src/assists.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! FIXME: write short doc here
22
3-
use ra_assists::{resolved_assists, AssistAction, AssistLabel};
3+
use ra_assists::{resolved_assists, AssistAction};
44
use ra_db::{FilePosition, FileRange};
55
use ra_ide_db::RootDatabase;
66

@@ -21,27 +21,22 @@ pub(crate) fn assists(db: &RootDatabase, frange: FileRange) -> Vec<Assist> {
2121
.into_iter()
2222
.map(|assist| {
2323
let file_id = frange.file_id;
24-
let assist_label = &assist.label;
2524
Assist {
26-
id: assist_label.id,
27-
label: assist_label.label.clone(),
28-
group_label: assist.group_label.map(|it| it.0),
29-
source_change: action_to_edit(assist.action, file_id, assist_label),
25+
id: assist.label.id,
26+
label: assist.label.label.clone(),
27+
group_label: assist.label.group.map(|it| it.0),
28+
source_change: action_to_edit(assist.action, file_id, assist.label.label.clone()),
3029
}
3130
})
3231
.collect()
3332
}
3433

35-
fn action_to_edit(
36-
action: AssistAction,
37-
file_id: FileId,
38-
assist_label: &AssistLabel,
39-
) -> SourceChange {
34+
fn action_to_edit(action: AssistAction, file_id: FileId, label: String) -> SourceChange {
4035
let file_id = match action.file {
4136
ra_assists::AssistFile::TargetFile(it) => it,
4237
_ => file_id,
4338
};
4439
let file_edit = SourceFileEdit { file_id, edit: action.edit };
45-
SourceChange::source_file_edit(assist_label.label.clone(), file_edit)
40+
SourceChange::source_file_edit(label, file_edit)
4641
.with_cursor_opt(action.cursor_position.map(|offset| FilePosition { offset, file_id }))
4742
}

0 commit comments

Comments
 (0)