Skip to content

Commit 38571a1

Browse files
committed
remove the try_from feature gate
replace with an inherent `try_from` implementation
1 parent f811a25 commit 38571a1

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/generate/device.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ pub fn render(d: &Device, target: &Target, nightly: bool, device_x: &mut String)
4343
#![no_std]
4444
});
4545

46-
if *target != Target::CortexM {
47-
out.push(quote! {
48-
#![feature(try_from)]
49-
});
50-
}
51-
5246
if nightly {
5347
out.push(quote! {
5448
#![feature(untagged_unions)]

src/generate/interrupt.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,14 @@ pub fn render(
233233
root.push(interrupt_enum);
234234
} else {
235235
mod_items.push(quote! {
236-
use core::convert::TryFrom;
237-
238236
#interrupt_enum
239237

240238
#[derive(Debug, Copy, Clone)]
241239
pub struct TryFromInterruptError(());
242240

243-
impl TryFrom<u8> for Interrupt {
244-
type Error = TryFromInterruptError;
245-
241+
impl Interrupt {
246242
#[inline]
247-
fn try_from(value: u8) -> Result<Self, Self::Error> {
243+
pub fn try_from(value: u8) -> Result<Self, TryFromInterruptError> {
248244
match value {
249245
#(#from_arms)*
250246
_ => Err(TryFromInterruptError(())),

0 commit comments

Comments
 (0)