about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2018-11-29 11:36:58 +1100
committerNicholas Nethercote <nnethercote@mozilla.com>2018-11-29 17:12:18 +1100
commit787959c20d062d396b97a5566e0a766d963af022 (patch)
tree4c4ca4239498d04470b497e5c6e7d0bb16cd1ffc /src/test/incremental/thinlto
parentdeb9195e5749c4f15e9a5ae0e7ee8e1802c716e4 (diff)
downloadrust-787959c20d062d396b97a5566e0a766d963af022.tar.gz
rust-787959c20d062d396b97a5566e0a766d963af022.zip
Use `Cow` in `Token::String`.
`Printer::word` takes a `&str` and converts it into a `String`, which
causes an allocation. But that allocation is rarely necessary, because
`&str` is almost always a `&'static str` or a `String` that won't be
used again.

This commit changes `Token::String` so it holds a `Cow<'static, str>`
instead of a `String`, which avoids a lot of allocations.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions