Skip to content

Commit e9d9dc1

Browse files
committed
Reorder traits
1 parent d85e455 commit e9d9dc1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/c_string.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ impl<const N: usize> CString<N> {
273273
}
274274
}
275275

276-
impl<const N: usize> Default for CString<N> {
276+
impl<const N: usize> AsRef<CStr> for CString<N> {
277277
#[inline]
278-
fn default() -> Self {
279-
Self::new()
278+
fn as_ref(&self) -> &CStr {
279+
self.as_c_str()
280280
}
281281
}
282282

@@ -287,10 +287,10 @@ impl<const N: usize> Borrow<CStr> for CString<N> {
287287
}
288288
}
289289

290-
impl<const N: usize> AsRef<CStr> for CString<N> {
290+
impl<const N: usize> Default for CString<N> {
291291
#[inline]
292-
fn as_ref(&self) -> &CStr {
293-
self.as_c_str()
292+
fn default() -> Self {
293+
Self::new()
294294
}
295295
}
296296

0 commit comments

Comments
 (0)