diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-08-15 14:27:29 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-08-16 16:35:23 +0200 |
| commit | 16b34bfae3f3a933b216dc6659ae4702168c723a (patch) | |
| tree | 08390e259e2e8e1d40dc66bbf163d265a7059f53 /src/librustdoc/html/highlight.rs | |
| parent | a1a94b1c0f0b990fa5dc0ecf05ba3acaa17a1d9a (diff) | |
| download | rust-16b34bfae3f3a933b216dc6659ae4702168c723a.tar.gz rust-16b34bfae3f3a933b216dc6659ae4702168c723a.zip | |
Use more named format args
Diffstat (limited to 'src/librustdoc/html/highlight.rs')
| -rw-r--r-- | src/librustdoc/html/highlight.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index e5d1b2f060c..039e8cdb987 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -937,7 +937,7 @@ fn string_without_closing_tag<T: Display>( write!(out, "{text}").unwrap(); return None; } - write!(out, "<span class=\"{}\">{text}", klass.as_html()).unwrap(); + write!(out, "<span class=\"{klass}\">{text}", klass = klass.as_html()).unwrap(); return Some("</span>"); }; @@ -947,11 +947,15 @@ fn string_without_closing_tag<T: Display>( match t { "self" | "Self" => write!( &mut path, - "<span class=\"{}\">{t}</span>", - Class::Self_(DUMMY_SP).as_html(), + "<span class=\"{klass}\">{t}</span>", + klass = Class::Self_(DUMMY_SP).as_html(), ), "crate" | "super" => { - write!(&mut path, "<span class=\"{}\">{t}</span>", Class::KeyWord.as_html()) + write!( + &mut path, + "<span class=\"{klass}\">{t}</span>", + klass = Class::KeyWord.as_html(), + ) } t => write!(&mut path, "{t}"), } |
