mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-17 17:10:28 +00:00
Run cargo fix --edition-idioms
This commit is contained in:
parent
23d25a3094
commit
816f7fe12a
230 changed files with 888 additions and 888 deletions
|
@ -66,7 +66,7 @@ macro_rules! _bail {
|
|||
pub use _bail as bail;
|
||||
|
||||
impl Definition {
|
||||
pub fn rename(&self, sema: &Semantics<RootDatabase>, new_name: &str) -> Result<SourceChange> {
|
||||
pub fn rename(&self, sema: &Semantics<'_, RootDatabase>, new_name: &str) -> Result<SourceChange> {
|
||||
match *self {
|
||||
Definition::Module(module) => rename_mod(sema, module, new_name),
|
||||
Definition::BuiltinType(_) => {
|
||||
|
@ -80,7 +80,7 @@ impl Definition {
|
|||
/// Textual range of the identifier which will change when renaming this
|
||||
/// `Definition`. Note that some definitions, like buitin types, can't be
|
||||
/// renamed.
|
||||
pub fn range_for_rename(self, sema: &Semantics<RootDatabase>) -> Option<FileRange> {
|
||||
pub fn range_for_rename(self, sema: &Semantics<'_, RootDatabase>) -> Option<FileRange> {
|
||||
let res = match self {
|
||||
Definition::Macro(mac) => {
|
||||
let src = mac.source(sema.db)?;
|
||||
|
@ -155,7 +155,7 @@ impl Definition {
|
|||
};
|
||||
return res;
|
||||
|
||||
fn name_range<D>(def: D, sema: &Semantics<RootDatabase>) -> Option<FileRange>
|
||||
fn name_range<D>(def: D, sema: &Semantics<'_, RootDatabase>) -> Option<FileRange>
|
||||
where
|
||||
D: HasSource,
|
||||
D::Ast: ast::HasName,
|
||||
|
@ -168,7 +168,7 @@ impl Definition {
|
|||
}
|
||||
|
||||
fn rename_mod(
|
||||
sema: &Semantics<RootDatabase>,
|
||||
sema: &Semantics<'_, RootDatabase>,
|
||||
module: hir::Module,
|
||||
new_name: &str,
|
||||
) -> Result<SourceChange> {
|
||||
|
@ -248,7 +248,7 @@ fn rename_mod(
|
|||
}
|
||||
|
||||
fn rename_reference(
|
||||
sema: &Semantics<RootDatabase>,
|
||||
sema: &Semantics<'_, RootDatabase>,
|
||||
def: Definition,
|
||||
new_name: &str,
|
||||
) -> Result<SourceChange> {
|
||||
|
@ -448,7 +448,7 @@ fn source_edit_from_name_ref(
|
|||
}
|
||||
|
||||
fn source_edit_from_def(
|
||||
sema: &Semantics<RootDatabase>,
|
||||
sema: &Semantics<'_, RootDatabase>,
|
||||
def: Definition,
|
||||
new_name: &str,
|
||||
) -> Result<(FileId, TextEdit)> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue