Matthias Krüger
510fc3432e
Rollup merge of #129550 - kornelski:boxasstr, r=joshtriplett,dtolnay
...
Add str.as_str() for easy Deref to string slices
Working with `Box<str>` is cumbersome, because in places like `iter.filter()` it can end up being `&Box<str>` or even `&&Box<str>`, and such type doesn't always get auto-dereferenced as expected.
Dereferencing such box to `&str` requires ugly syntax like `&**boxed_str` or `&***boxed_str`, with the exact amount of `*`s.
`Box<str>` is [not easily comparable with other string types](https://github.com/rust-lang/rust/pull/129852 ) via `PartialEq`. `Box<str>` won't work for lookups in types like `HashSet<String>`, because `Borrow<String>` won't take types like `&Box<str>`. OTOH `set.contains(s.as_str())` works nicely regardless of levels of indirection.
`String` has a simple solution for this: the `as_str()` method, and `Box<str>` should too.
2024-09-23 06:45:32 +02:00
..
2024-08-31 15:35:42 +03:00
2024-02-16 20:02:50 +00:00
2024-06-21 19:00:18 -04:00
2024-02-01 03:31:03 +00:00
2024-07-14 13:50:09 +09:00
2023-12-04 21:54:32 +00:00
2023-12-07 23:00:46 -05:00
2023-01-11 09:32:08 +00:00
2023-11-24 19:15:52 +01:00
2024-03-03 18:53:35 +00:00
2024-01-09 21:08:16 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-09-07 21:06:49 +07:00
2023-01-11 09:32:08 +00:00
2024-02-22 18:05:27 +00:00
2023-11-29 18:55:00 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-08 08:10:43 +00:00
2024-02-08 08:10:43 +00:00
2024-02-08 08:10:43 +00:00
2024-08-31 15:35:42 +03:00
2024-08-31 15:35:42 +03:00
2024-02-08 08:10:43 +00:00
2024-07-18 18:20:32 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-07-15 12:12:44 +02:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-08-28 22:55:57 +09:00
2024-05-30 22:52:33 +02:00
2024-03-20 17:29:58 +00:00
2024-07-22 22:04:49 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-27 10:54:31 +03:00
2023-11-24 19:15:52 +01:00
2024-07-22 22:51:53 +00:00
2023-05-27 00:52:07 +08:00
2023-01-12 20:17:25 +08:00
2023-01-30 20:12:19 +00:00
2023-03-20 22:48:26 +08:00
2024-05-23 07:23:59 +05:30
2023-07-02 15:35:18 +08:00
2023-07-02 15:35:18 +08:00
2023-11-24 19:15:52 +01:00
2024-07-04 17:56:09 +02:00
2024-07-12 03:02:57 +00:00
2024-09-20 22:18:57 -04:00
2024-09-20 22:18:57 -04:00
2024-02-14 11:00:30 +00:00
2024-02-16 20:02:50 +00:00
2024-06-23 23:44:22 +08:00
2024-02-08 08:10:43 +00:00
2024-09-16 10:55:07 -04:00
2024-09-16 10:55:07 -04:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-08-03 07:57:31 -04:00
2024-01-30 21:28:18 +00:00
2024-07-12 03:02:57 +00:00
2024-03-13 23:05:17 +00:00
2023-08-03 16:44:02 +08:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-11 09:32:08 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-02-10 18:18:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-23 20:22:17 +08:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-12-22 11:01:07 -08:00
2024-03-17 19:21:13 +09:00
2024-07-04 05:50:21 +00:00
2023-10-30 22:12:07 +00:00
2024-05-20 19:55:59 -07:00
2024-05-20 19:55:59 -07:00
2024-08-28 12:54:39 +08:00
2024-08-28 12:54:39 +08:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00