We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3243cd9 commit a0b4219Copy full SHA for a0b4219
library/alloc/src/ffi/c_str.rs
@@ -827,15 +827,15 @@ impl FromStr for CString {
827
}
828
829
830
-impl TryInto<String> for CString {
+impl TryFrom<CString> for String {
831
type Error = IntoStringError;
832
833
- /// Converts the `CString` into a [`String`] if it contains valid UTF-8 data.
+ /// Converts a [`CString`] into a [`String`] if it contains valid UTF-8 data.
834
///
835
/// This method is equivalent to [`CString::into_string`].
836
#[inline]
837
- fn try_into(self) -> Result<String, Self::Error> {
838
- self.into_string()
+ fn try_from(value: CString) -> Result<Self, Self::Error> {
+ value.into_string()
839
840
841
0 commit comments