@@ -269,6 +269,7 @@ impl Error {
269
269
/// This function should maybe change to
270
270
/// `new_const<const MSG: &'static str>(kind: ErrorKind)`
271
271
/// in the future, when const generics allow that.
272
+ #[ inline]
272
273
pub ( crate ) const fn new_const ( kind : ErrorKind , message : & ' static & ' static str ) -> Error {
273
274
Self { repr : Repr :: SimpleMessage ( kind, message) }
274
275
}
@@ -287,6 +288,7 @@ impl Error {
287
288
/// println!("last OS error: {:?}", Error::last_os_error());
288
289
/// ```
289
290
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
291
+ #[ inline]
290
292
pub fn last_os_error ( ) -> Error {
291
293
Error :: from_raw_os_error ( sys:: os:: errno ( ) as i32 )
292
294
}
@@ -317,6 +319,7 @@ impl Error {
317
319
/// # }
318
320
/// ```
319
321
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
322
+ #[ inline]
320
323
pub fn from_raw_os_error ( code : i32 ) -> Error {
321
324
Error { repr : Repr :: Os ( code) }
322
325
}
@@ -351,6 +354,7 @@ impl Error {
351
354
/// }
352
355
/// ```
353
356
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
357
+ #[ inline]
354
358
pub fn raw_os_error ( & self ) -> Option < i32 > {
355
359
match self . repr {
356
360
Repr :: Os ( i) => Some ( i) ,
@@ -388,6 +392,7 @@ impl Error {
388
392
/// }
389
393
/// ```
390
394
#[ stable( feature = "io_error_inner" , since = "1.3.0" ) ]
395
+ #[ inline]
391
396
pub fn get_ref ( & self ) -> Option < & ( dyn error:: Error + Send + Sync + ' static ) > {
392
397
match self . repr {
393
398
Repr :: Os ( ..) => None ,
@@ -460,6 +465,7 @@ impl Error {
460
465
/// }
461
466
/// ```
462
467
#[ stable( feature = "io_error_inner" , since = "1.3.0" ) ]
468
+ #[ inline]
463
469
pub fn get_mut ( & mut self ) -> Option < & mut ( dyn error:: Error + Send + Sync + ' static ) > {
464
470
match self . repr {
465
471
Repr :: Os ( ..) => None ,
@@ -497,6 +503,7 @@ impl Error {
497
503
/// }
498
504
/// ```
499
505
#[ stable( feature = "io_error_inner" , since = "1.3.0" ) ]
506
+ #[ inline]
500
507
pub fn into_inner ( self ) -> Option < Box < dyn error:: Error + Send + Sync > > {
501
508
match self . repr {
502
509
Repr :: Os ( ..) => None ,
@@ -525,6 +532,7 @@ impl Error {
525
532
/// }
526
533
/// ```
527
534
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
535
+ #[ inline]
528
536
pub fn kind ( & self ) -> ErrorKind {
529
537
match self . repr {
530
538
Repr :: Os ( code) => sys:: decode_error_kind ( code) ,
0 commit comments