From f5a81ec4683613bd62624811733345d627f2127b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 30 Jan 2021 18:19:21 +0300 Subject: Upgrade rowan Notably, new rowan comes with support for mutable syntax trees. --- crates/ide/src/syntax_highlighting/format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ide/src/syntax_highlighting/format.rs') diff --git a/crates/ide/src/syntax_highlighting/format.rs b/crates/ide/src/syntax_highlighting/format.rs index 8c67a0863..e503abc93 100644 --- a/crates/ide/src/syntax_highlighting/format.rs +++ b/crates/ide/src/syntax_highlighting/format.rs @@ -28,7 +28,7 @@ pub(super) fn highlight_format_string( } fn is_format_string(string: &ast::String) -> Option<()> { - let parent = string.syntax().parent(); + let parent = string.syntax().parent()?; let name = parent.parent().and_then(ast::MacroCall::cast)?.path()?.segment()?.name_ref()?; if !matches!(name.text(), "format_args" | "format_args_nl") { -- cgit v1.2.3