Skip to content

Commit 29372c8

Browse files
author
Flix
committed
Add inlines
1 parent 75daef7 commit 29372c8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/error.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ impl CtxErrorImpl {
365365
}
366366

367367
impl From<CtxError> for CtxErrorImpl {
368+
#[inline]
368369
fn from(err: CtxError) -> Self {
369370
err.0
370371
}
@@ -382,47 +383,54 @@ where
382383
}
383384

384385
impl Error for CtxErrorImpl {
386+
#[inline]
385387
fn source(&self) -> Option<&(dyn Error + 'static)> {
386388
#[expect(trivial_casts, reason = "Not that trivial as it seems? False positive")]
387389
self.source.as_deref().map(|e| e as &(dyn Error + 'static))
388390
}
389391
}
390392

391393
impl AsRef<dyn Error> for CtxError {
394+
#[inline]
392395
fn as_ref(&self) -> &(dyn Error + 'static) {
393396
&self.0
394397
}
395398
}
396399

397400
#[cfg(feature = "send")]
398401
impl AsRef<dyn Error + Send> for CtxError {
402+
#[inline]
399403
fn as_ref(&self) -> &(dyn Error + Send + 'static) {
400404
&self.0
401405
}
402406
}
403407

404408
#[cfg(all(feature = "send", feature = "sync"))]
405409
impl AsRef<dyn Error + Send + Sync> for CtxError {
410+
#[inline]
406411
fn as_ref(&self) -> &(dyn Error + Send + Sync + 'static) {
407412
&self.0
408413
}
409414
}
410415

411416
impl From<CtxError> for Box<dyn Error> {
417+
#[inline]
412418
fn from(this: CtxError) -> Self {
413419
Box::new(this.into_error())
414420
}
415421
}
416422

417423
#[cfg(feature = "send")]
418424
impl From<CtxError> for Box<dyn Error + Send> {
425+
#[inline]
419426
fn from(this: CtxError) -> Self {
420427
Box::new(this.into_error())
421428
}
422429
}
423430

424431
#[cfg(all(feature = "send", feature = "sync"))]
425432
impl From<CtxError> for Box<dyn Error + Send + Sync> {
433+
#[inline]
426434
fn from(this: CtxError) -> Self {
427435
Box::new(this.into_error())
428436
}
@@ -431,13 +439,15 @@ impl From<CtxError> for Box<dyn Error + Send + Sync> {
431439

432440
#[cfg(feature = "std")]
433441
impl std::process::Termination for CtxError {
442+
#[inline]
434443
fn report(self) -> std::process::ExitCode {
435444
std::process::Termination::report(self.0)
436445
}
437446
}
438447

439448
#[cfg(feature = "std")]
440449
impl std::process::Termination for CtxErrorImpl {
450+
#[inline]
441451
fn report(self) -> std::process::ExitCode {
442452
self.attachment::<std::process::ExitCode>()
443453
.copied()

0 commit comments

Comments
 (0)