diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-03-15 17:24:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-15 17:24:10 +0100 |
| commit | 6ec4092eaf26332fa1b77c52471f44fa0b01c7e7 (patch) | |
| tree | ec796409ab2270ff02a002c7c524905dd214966f /src/librustdoc | |
| parent | 3d4464d4d75b0693de72aad3d9eb066ad25bc912 (diff) | |
| parent | 7ea4f3576675617c68e70014c955a49127c78fe0 (diff) | |
| download | rust-6ec4092eaf26332fa1b77c52471f44fa0b01c7e7.tar.gz rust-6ec4092eaf26332fa1b77c52471f44fa0b01c7e7.zip | |
Rollup merge of #122530 - klensy:as_str, r=fee1-dead
less symbol interner locks This reduces instructions under 1% (in rustdoc run), but essentially free.
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index fe83095f944..bfd67ccbd3f 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1698,9 +1698,10 @@ fn render_impl( let id = cx.derive_id(format!("{item_type}.{name}")); let source_id = trait_ .and_then(|trait_| { - trait_.items.iter().find(|item| { - item.name.map(|n| n.as_str().eq(name.as_str())).unwrap_or(false) - }) + trait_ + .items + .iter() + .find(|item| item.name.map(|n| n == *name).unwrap_or(false)) }) .map(|item| format!("{}.{name}", item.type_())); write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">"); |
