@@ -274,12 +274,14 @@ impl<const N: usize> CString<N> {
274
274
}
275
275
276
276
impl < const N : usize > Borrow < CStr > for CString < N > {
277
+ #[ inline]
277
278
fn borrow ( & self ) -> & CStr {
278
279
self . as_c_str ( )
279
280
}
280
281
}
281
282
282
283
impl < const N : usize > AsRef < CStr > for CString < N > {
284
+ #[ inline]
283
285
fn as_ref ( & self ) -> & CStr {
284
286
self . as_c_str ( )
285
287
}
@@ -288,24 +290,28 @@ impl<const N: usize> AsRef<CStr> for CString<N> {
288
290
impl < const N : usize > Deref for CString < N > {
289
291
type Target = CStr ;
290
292
293
+ #[ inline]
291
294
fn deref ( & self ) -> & Self :: Target {
292
295
self . as_c_str ( )
293
296
}
294
297
}
295
298
296
299
impl < const N : usize , T : AsRef < CStr > > PartialEq < T > for CString < N > {
300
+ #[ inline]
297
301
fn eq ( & self , rhs : & T ) -> bool {
298
302
self . as_c_str ( ) == rhs. as_ref ( )
299
303
}
300
304
}
301
305
302
306
impl < const N : usize > PartialEq < CString < N > > for CStr {
307
+ #[ inline]
303
308
fn eq ( & self , rhs : & CString < N > ) -> bool {
304
309
self == rhs. as_c_str ( )
305
310
}
306
311
}
307
312
308
313
impl < const N : usize > PartialEq < CString < N > > for & CStr {
314
+ #[ inline]
309
315
fn eq ( & self , rhs : & CString < N > ) -> bool {
310
316
* self == rhs. as_c_str ( )
311
317
}
@@ -314,12 +320,14 @@ impl<const N: usize> PartialEq<CString<N>> for &CStr {
314
320
impl < const N : usize > Eq for CString < N > { }
315
321
316
322
impl < const N : usize , T : AsRef < CStr > > PartialOrd < T > for CString < N > {
323
+ #[ inline]
317
324
fn partial_cmp ( & self , rhs : & T ) -> Option < Ordering > {
318
325
self . as_c_str ( ) . partial_cmp ( rhs. as_ref ( ) )
319
326
}
320
327
}
321
328
322
329
impl < const N : usize > Ord for CString < N > {
330
+ #[ inline]
323
331
fn cmp ( & self , rhs : & Self ) -> Ordering {
324
332
self . as_c_str ( ) . cmp ( rhs. as_c_str ( ) )
325
333
}
0 commit comments