From aa886569edc9506f2092c32c21773d05b3915dfb Mon Sep 17 00:00:00 2001 From: Chris Wong Date: Sat, 15 Dec 2018 18:29:45 +0100 Subject: [PATCH] Update patterns/unsafe-mods.md Co-Authored-By: llogiq --- patterns/unsafe-mods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patterns/unsafe-mods.md b/patterns/unsafe-mods.md index f8f0512..735d2a0 100644 --- a/patterns/unsafe-mods.md +++ b/patterns/unsafe-mods.md @@ -17,7 +17,7 @@ If you have `unsafe` code, create the smallest possible module that can uphold t ## Examples * The [`optional`](https://crates.io/crates/optional) crate has one unsafe module for converting a `&T` to either a slice of one `[T]` or an empty slice. -* `std`s `String` class is basically just a wrapper over `Vec` with the added invariant that the contents must be valid unicode. The operations on `String` ensure this behavior, however, users have the option of using an `unsafe` method to create a `String`, in which case the onus is on them to guarantee the validity of the contents. +* `std`s `String` class is a wrapper over `Vec` with the added invariant that the contents must be valid UTF-8. The operations on `String` ensure this behavior. However, users have the option of using an `unsafe` method to create a `String`, in which case the onus is on them to guarantee the validity of the contents. ## See also