Renaming name of variable

Question: I want like const values, change the value in one place, and automatically change in others.
But not value, I want to rename name of variable to another (or massive,etc...) And automatically changing in other, how it can be done?)

Variable names don't exist at runtime in Rust. What do you mean by "changing" them?

1 Like

Only for convenience, if i would like to rename(for ex massive) them later, can i write something, to change only that and effect on other parts where this variable is?

Are you looking for a refactoring tool or IDE which can rename all occurrences of a specified item?

I believe @Maxim is asking for a refactoring tool that renames all uses of a variable throughout a rust code base. Perhaps someone familiar with rust support for this in some popular IDE could pipe in here?

1 Like

Both VSCode + Rust-Analyzer and InteliJ Rust support such opration. Right click the definition of the name, and click Rename Symbol in VSCode or Refactor > Rename... in InteliJ.


Yes, thanks)

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.