diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-04-18 14:05:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-18 14:05:42 -0400 |
| commit | 353bdb30e35aa03cc3055505687eb77b304441b1 (patch) | |
| tree | 81327e3b29267a72de6973f2a15b56b879c4ab26 /src/doc | |
| parent | c398efc53f09f6e1a8cba4ec2259ffb9d89f0542 (diff) | |
| parent | bbdf190c6a2d5bc095c8d3addff0868395bff31f (diff) | |
Rollup merge of #40290 - 3Hren:master, r=aturon
Add `as_bytes()` for `FromUtf8Error`. This change allows to obtain an underlying invalid UTF-8 bytes without `FromUtf8Error` destruction. Such method may be useful for example in a library that attempts to save both valid and invalid UTF-8 strings in some struct and to be able to provide immutable access to it without destruction. Personally without this change I ended with `Result<String, (Vec<u8>, Utf8Error)`, which almost copies the functionality of `FromUtf8Error`, but allows immutable view access.
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/SUMMARY.md | 1 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/from_utf8_error_as_bytes.md | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/doc/unstable-book/src/SUMMARY.md b/src/doc/unstable-book/src/SUMMARY.md index d492903f03f..36999eb143f 100644 --- a/src/doc/unstable-book/src/SUMMARY.md +++ b/src/doc/unstable-book/src/SUMMARY.md @@ -79,6 +79,7 @@ - [fmt_internals](fmt-internals.md) - [fn_traits](fn-traits.md) - [fnbox](fnbox.md) +- [from_utf8_error_as_bytes](from_utf8_error_as_bytes.md) - [fundamental](fundamental.md) - [fused](fused.md) - [future_atomic_orderings](future-atomic-orderings.md) diff --git a/src/doc/unstable-book/src/from_utf8_error_as_bytes.md b/src/doc/unstable-book/src/from_utf8_error_as_bytes.md new file mode 100644 index 00000000000..570f779417f --- /dev/null +++ b/src/doc/unstable-book/src/from_utf8_error_as_bytes.md @@ -0,0 +1,7 @@ +# `from_utf8_error_as_bytes` + +The tracking issue for this feature is: [#40895] + +[#40895]: https://github.com/rust-lang/rust/issues/40895 + +------------------------ |
