about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-07-18 22:19:52 +0000
committerbors <bors@rust-lang.org>2022-07-18 22:19:52 +0000
commit567a5e9ef7c753e03d528cbc19110db99e8d6878 (patch)
tree7fe93e36bdeacf1a9086356cb0ec1761eae7df0b /src/test/codegen/src-hash-algorithm
parentdc05192e1106668912dab2800215e39f0aa4b98f (diff)
parentbe30c4daf4d8c54c261a346a4c4750f13b426005 (diff)
downloadrust-567a5e9ef7c753e03d528cbc19110db99e8d6878.tar.gz
rust-567a5e9ef7c753e03d528cbc19110db99e8d6878.zip
Auto merge of #12796 - mmirate:patch-1, r=Veykril
chore: change str_ref_to_string to str_ref_to_owned

`ToString` is implemented by many different types than `&str`, and represents a serialization into string data. The fact that said data is returned as owned, is an implementation detail resulting from the lack of a parameter for a pre-allocated buffer.

If merely copying borrowed string data to owned string data is all that is desired, `ToOwned` is a much better choice, because if the user later refactors the code such that the input is no longer an `&str`, then they will get a compiler error instead of a mysterious runtime-behavioral change.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions