From 847d5b4d1387a30f1798a5c3c59c3e0c31e00319 Mon Sep 17 00:00:00 2001 From: kennytm Date: Sun, 2 Feb 2020 02:29:28 +0800 Subject: Derive Clone + PartialEq + Eq for std::string::FromUtf8Error --- src/liballoc/string.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/liballoc/string.rs') diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 96f871d8897..8c9c95eec60 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -319,7 +319,7 @@ pub struct String { /// assert_eq!(vec![0, 159], value.unwrap_err().into_bytes()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[derive(Debug)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct FromUtf8Error { bytes: Vec, error: Utf8Error, -- cgit 1.4.1-3-g733a5 From fd2282388140ea0f370ee25c82f00be81c2f822c Mon Sep 17 00:00:00 2001 From: Trevor Spiteri Date: Sat, 1 Feb 2020 22:19:28 +0100 Subject: implement AsMut for String --- src/liballoc/string.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/liballoc/string.rs') diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 96f871d8897..99725917b5d 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -2208,6 +2208,14 @@ impl AsRef for String { } } +#[stable(feature = "string_as_mut", since = "1.43.0")] +impl AsMut for String { + #[inline] + fn as_mut(&mut self) -> &mut str { + self + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl AsRef<[u8]> for String { #[inline] -- cgit 1.4.1-3-g733a5