Skip to content

Commit 13c078d

Browse files
committed
Flip Assist::new arguments
1 parent 8803e74 commit 13c078d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/ra_assists/src/assist_ctx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<'a> AssistCtx<'a> {
100100
label: impl Into<String>,
101101
f: impl FnOnce(&mut ActionBuilder),
102102
) -> Option<Assist> {
103-
let label = AssistLabel::new(label.into(), id);
103+
let label = AssistLabel::new(id, label.into());
104104

105105
let mut info = AssistInfo::new(label);
106106
if self.should_compute_edit {
@@ -157,7 +157,7 @@ impl<'a> AssistGroup<'a> {
157157
label: impl Into<String>,
158158
f: impl FnOnce(&mut ActionBuilder),
159159
) {
160-
let label = AssistLabel::new(label.into(), id);
160+
let label = AssistLabel::new(id, label.into());
161161

162162
let mut info = AssistInfo::new(label).with_group(GroupLabel(self.group_name.clone()));
163163
if self.ctx.should_compute_edit {

crates/ra_assists/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ pub struct AssistId(pub &'static str);
3232

3333
#[derive(Debug, Clone)]
3434
pub struct AssistLabel {
35+
pub id: AssistId,
3536
/// Short description of the assist, as shown in the UI.
3637
pub label: String,
37-
pub id: AssistId,
3838
}
3939

4040
#[derive(Clone, Debug)]
4141
pub struct GroupLabel(pub String);
4242

4343
impl AssistLabel {
44-
pub(crate) fn new(label: String, id: AssistId) -> AssistLabel {
44+
pub(crate) fn new(id: AssistId, label: String) -> AssistLabel {
4545
// FIXME: make fields private, so that this invariant can't be broken
4646
assert!(label.starts_with(|c: char| c.is_uppercase()));
4747
AssistLabel { label, id }

0 commit comments

Comments
 (0)