Skip to content

Commit f2f676b

Browse files
authored
Merge pull request #126 from alistair23/alistair/inline
examples: mark as `#[inline]` all `From::from()`s for `Error`
2 parents 08a1b35 + 90f30de commit f2f676b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

examples/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ use std::alloc::AllocError;
1111
pub struct Error;
1212

1313
impl From<Infallible> for Error {
14+
#[inline]
1415
fn from(e: Infallible) -> Self {
1516
match e {}
1617
}
1718
}
1819

1920
#[cfg(feature = "alloc")]
2021
impl From<AllocError> for Error {
22+
#[inline]
2123
fn from(_: AllocError) -> Self {
2224
Self
2325
}

0 commit comments

Comments
 (0)