Skip to content

Commit 11cc875

Browse files
committed
Added const to new functions
1 parent 9ea5009 commit 11cc875

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ macro_rules! plic_context {
8888

8989
impl $PLIC {
9090
/// Creates a new PLIC context interface.
91-
pub fn new() -> Self {
91+
pub const fn new() -> Self {
9292
Self {
9393
context: $crate::peripheral::PLIC::new(),
9494
}

src/peripheral.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<const BASE: usize, const CONTEXT: usize> PLIC<BASE, CONTEXT> {
3636

3737
/// Creates a new interface for the PLIC peripheral. PACs can use this
3838
/// function to add a PLIC interface to their `Peripherals` struct.
39-
pub fn new() -> Self {
39+
pub const fn new() -> Self {
4040
Self {
4141
_marker: PhantomData,
4242
}

0 commit comments

Comments
 (0)