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 d85e455 commit e9d9dc1Copy full SHA for e9d9dc1
src/c_string.rs
@@ -273,10 +273,10 @@ impl<const N: usize> CString<N> {
273
}
274
275
276
-impl<const N: usize> Default for CString<N> {
+impl<const N: usize> AsRef<CStr> for CString<N> {
277
#[inline]
278
- fn default() -> Self {
279
- Self::new()
+ fn as_ref(&self) -> &CStr {
+ self.as_c_str()
280
281
282
@@ -287,10 +287,10 @@ impl<const N: usize> Borrow<CStr> for CString<N> {
287
288
289
290
-impl<const N: usize> AsRef<CStr> for CString<N> {
+impl<const N: usize> Default for CString<N> {
291
292
- fn as_ref(&self) -> &CStr {
293
- self.as_c_str()
+ fn default() -> Self {
+ Self::new()
294
295
296
0 commit comments