Matthias Krüger
08d5b2303a
Rollup merge of #135073 - joshtriplett:bstr, r=BurntSushi
...
Implement `ByteStr` and `ByteString` types
Approved ACP: https://github.com/rust-lang/libs-team/issues/502
Tracking issue: https://github.com/rust-lang/rust/issues/134915
These types represent human-readable strings that are conventionally,
but not always, UTF-8. The `Debug` impl prints non-UTF-8 bytes using
escape sequences, and the `Display` impl uses the Unicode replacement
character.
This is a minimal implementation of these types and associated trait
impls. It does not add any helper methods to other types such as `[u8]`
or `Vec<u8>`.
I've omitted a few implementations of `AsRef`, `AsMut`, and `Borrow`,
when those would be the second implementation for a type (counting the
`T` impl), to avoid potential inference failures. We can attempt to add
more impls later in standalone commits, and run them through crater.
In addition to the `bstr` feature, I've added a `bstr_internals` feature
for APIs provided by `core` for use by `alloc` but not currently
intended for stabilization.
This API and its implementation are based *heavily* on the `bstr` crate
by Andrew Gallant (`@BurntSushi).`
r? `@BurntSushi`
2025-01-23 19:54:23 +01:00
..
2025-01-06 16:08:29 -08: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-01-09 21:08:16 +00:00
2024-03-07 14:26:31 +00:00
2024-01-09 21:08:16 +00:00
2024-01-09 21:08:16 +00:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +01:00
2023-12-06 11:05:22 +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
2024-11-26 02:50:48 +08: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
2024-02-16 20:02:50 +00:00
2024-10-15 13:11:00 +02:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08: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-12-30 14:56:21 +07:00
2024-12-12 23:36:27 +00:00
2024-07-09 07:44:17 +00:00
2024-07-09 07:44:17 +00:00
2024-02-08 08:10:43 +00:00
2024-02-08 08:10:43 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-01-06 17:58:30 +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-12-27 19:58:16 +11:00
2025-01-11 06:35:21 +02: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
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-10-30 22:12:07 +00:00
2023-10-30 22:12:07 +00:00
2023-08-26 19:35:54 +00:00
2024-07-17 19:08:37 +08:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2023-11-24 19:15:52 +01:00
2024-11-26 02:50:48 +08: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
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-02-14 11:00:30 +00:00
2025-01-06 17:58:30 +00:00
2024-02-14 11:00:30 +00:00
2025-01-06 17:58:30 +00:00
2024-02-14 11:00:30 +00:00
2025-01-06 17:58:30 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-04-11 16:41:41 +00:00
2024-07-26 14:41:56 -04:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-10-17 17:33:55 +00:00
2024-01-24 02:53:15 +00:00
2024-01-24 02:53:15 +00:00
2025-01-06 16:08:29 -08: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
2024-03-07 14:26:31 +00: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
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08: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
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-01-24 02:53:15 +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-05-09 14:47:09 +10:00
2024-05-09 14:47:09 +10:00
2023-12-12 17:40:53 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-12-12 17:40:53 +01: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
2024-01-02 14:17:56 +00:00
2024-01-02 14:17:56 +00:00
2024-01-02 14:17:56 +00:00
2024-01-02 14:17:56 +00: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
2024-07-05 20:58:33 +00:00
2024-12-07 21:29:58 +00:00
2024-12-07 21:29:58 +00:00
2024-05-30 15:52:29 -04:00
2024-05-30 15:52:29 -04:00
2024-06-13 08:52:35 -04:00
2024-06-13 08:52:35 -04:00
2024-05-30 15:52:29 -04:00
2024-06-13 08:52:35 -04:00
2024-06-13 08:52:35 -04:00
2024-02-01 03:30:26 +00:00
2023-08-17 14:33:33 +02:00
2023-12-07 23:00:46 -05:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-10-29 16:26:57 +00:00
2023-11-24 19:15:52 +01:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-10-29 16:26:57 +00:00
2024-02-14 11:00:30 +00:00
2024-10-29 16:26:57 +00:00
2024-02-14 11:00:30 +00:00
2024-11-12 02:08:39 +00:00
2024-02-14 11:00:30 +00:00
2024-11-12 02:08:39 +00:00
2024-02-14 11:00:30 +00:00
2024-11-12 02:08:39 +00:00
2024-11-12 02:08:39 +00:00
2024-12-07 21:29:58 +00:00
2024-03-04 21:06:52 +01:00
2024-12-07 22:18:51 +00:00
2024-10-16 13:44:56 -04:00
2024-01-19 23:55:05 +00:00
2024-01-22 17:52:36 +00:00
2024-01-19 23:55:05 +00:00
2024-01-19 23:55:05 +00:00
2024-01-19 23:55:05 +00:00
2024-01-19 23:55:05 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-03-01 13:48:20 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-09-25 13:13:04 -04:00
2024-09-25 13:13:04 -04:00
2024-09-25 13:13:04 -04:00
2025-01-06 18:04:33 +00:00
2025-01-06 18:04:33 +00:00
2025-01-06 18:04:33 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2023-11-24 19:15:52 +01:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-11-23 18:54:08 +00:00
2024-11-23 18:54:08 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-01-11 09:03:26 +00:00
2024-01-11 09:03:26 +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
2024-02-16 20:02:50 +00: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
2024-01-02 15:34:37 -05:00
2024-04-24 22:21:15 +00:00
2024-03-03 16:30:48 -03:00
2024-03-03 16:30:48 -03:00
2023-11-24 19:15:52 +01:00
2024-12-07 21:29:58 +00: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-08-28 17:47:37 -03: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-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-10-29 16:26:57 +00: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
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-12-07 21:29:58 +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
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
2024-02-16 20:02:50 +00:00
2024-05-30 15:52:29 -04:00
2024-06-13 08:52:35 -04:00
2024-06-13 08:52:35 -04: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
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2025-01-06 17:58:30 +00:00
2023-11-24 19:15:52 +01:00
2024-03-08 20:56:25 +00:00
2024-05-30 15:52:29 -04:00
2024-05-30 15:52:29 -04:00
2024-05-30 15:52:29 -04: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-10-29 16:26:57 +00: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
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-09-09 18:00:13 +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
2025-01-07 16:04:14 +01:00
2024-02-16 20:02:50 +00:00
2024-11-23 18:54:08 +00:00
2024-12-11 19:53:40 +00: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
2024-02-16 20:02:50 +00: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
2024-02-16 20:02:50 +00: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-09-10 21:20:36 +00:00
2023-11-24 19:15:52 +01:00
2024-12-30 14:56:21 +07:00
2024-02-16 20:02:50 +00:00
2025-01-03 02:45:29 +00:00
2025-01-03 02:45:29 +00:00
2024-10-29 16:26:57 +00:00
2024-03-18 16:44:12 +00:00
2024-10-29 16:26:57 +00:00
2024-02-01 03:30:26 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00