aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/builtin_macro.rs
diff options
context:
space:
mode:
authorMaan2003 <[email protected]>2021-06-13 04:55:55 +0100
committerMaan2003 <[email protected]>2021-06-13 04:55:55 +0100
commit6cc6dee9e96d55dbbd8593523551a9981a691147 (patch)
treec9a790918f586acd877908a5b34e6b073d551b49 /crates/hir_expand/src/builtin_macro.rs
parentc9b4ac5be4daaabc062ab1ee663eba8594750003 (diff)
clippy::useless_conversion
Diffstat (limited to 'crates/hir_expand/src/builtin_macro.rs')
-rw-r--r--crates/hir_expand/src/builtin_macro.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index 51572226e..f24d1d919 100644
--- a/crates/hir_expand/src/builtin_macro.rs
+++ b/crates/hir_expand/src/builtin_macro.rs
@@ -430,7 +430,7 @@ fn include_expand(
430) -> ExpandResult<Option<ExpandedEager>> { 430) -> ExpandResult<Option<ExpandedEager>> {
431 let res = (|| { 431 let res = (|| {
432 let path = parse_string(tt)?; 432 let path = parse_string(tt)?;
433 let file_id = relative_file(db, arg_id.into(), &path, false)?; 433 let file_id = relative_file(db, arg_id, &path, false)?;
434 434
435 let subtree = parse_to_token_tree(&db.file_text(file_id)) 435 let subtree = parse_to_token_tree(&db.file_text(file_id))
436 .ok_or_else(|| mbe::ExpandError::ConversionError)? 436 .ok_or_else(|| mbe::ExpandError::ConversionError)?
@@ -480,7 +480,7 @@ fn include_str_expand(
480 // it's unusual to `include_str!` a Rust file), but we can return an empty string. 480 // it's unusual to `include_str!` a Rust file), but we can return an empty string.
481 // Ideally, we'd be able to offer a precise expansion if the user asks for macro 481 // Ideally, we'd be able to offer a precise expansion if the user asks for macro
482 // expansion. 482 // expansion.
483 let file_id = match relative_file(db, arg_id.into(), &path, true) { 483 let file_id = match relative_file(db, arg_id, &path, true) {
484 Ok(file_id) => file_id, 484 Ok(file_id) => file_id,
485 Err(_) => { 485 Err(_) => {
486 return ExpandResult::ok(Some(ExpandedEager::new(quote!("")))); 486 return ExpandResult::ok(Some(ExpandedEager::new(quote!(""))));
@@ -598,7 +598,7 @@ mod tests {
598 }, 598 },
599 }; 599 };
600 600
601 let id: MacroCallId = db.intern_macro(loc).into(); 601 let id: MacroCallId = db.intern_macro(loc);
602 id.as_file() 602 id.as_file()
603 } 603 }
604 Either::Right(expander) => { 604 Either::Right(expander) => {
@@ -635,7 +635,7 @@ mod tests {
635 kind: MacroCallKind::FnLike { ast_id: call_id, fragment }, 635 kind: MacroCallKind::FnLike { ast_id: call_id, fragment },
636 }; 636 };
637 637
638 let id: MacroCallId = db.intern_macro(loc).into(); 638 let id: MacroCallId = db.intern_macro(loc);
639 id.as_file() 639 id.as_file()
640 } 640 }
641 }; 641 };