Skip to content

Conversation

@matklad
Copy link
Contributor

@matklad matklad commented Dec 23, 2020

bors r+
🤖

Avoid mutation of snapshot's config -- that's spooky action at a
distance. Instead, copy it over to a local variable.

This points out a minor architecture problem, which we won't fix right
away.

Various `ide`-level config structs, like `AssistConfig`, are geared
towards one-shot use when calling a specific methods. On the other
hand, the large `Config` struct in `rust-analyzer` is a long-term
config store.

The fact that `Config` stores `AssistConfig` is accidental -- a better
design would probably be to just store `ConfigData` inside `Config`
and create various `Config`s on the fly out of it.
bors bot added a commit that referenced this pull request Dec 23, 2020
7018: Cleanup handle_code_action r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
@bors
Copy link
Contributor

bors bot commented Dec 23, 2020

Build failed:

* Push control flow outwards, as per
  https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/style.md#preconditions

* Don't re-do the work, pass-in the arguments
@matklad
Copy link
Contributor Author

matklad commented Dec 23, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 23, 2020

@bors bors bot merged commit 0dec77a into rust-lang:master Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant