Skip to content

Commit f235452

Browse files
committed
Use cargo fmt to reformat code
1 parent 06f784f commit f235452

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/register/scause.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,17 @@ pub unsafe fn write(bits: usize) {
127127
#[inline]
128128
pub unsafe fn set(cause: Trap) {
129129
let bits = match cause {
130-
Trap::Interrupt(i) => (match i {
131-
Interrupt::UserSoft => 0,
132-
Interrupt::SupervisorSoft => 1,
133-
Interrupt::UserTimer => 4,
134-
Interrupt::SupervisorTimer => 5,
135-
Interrupt::UserExternal => 8,
136-
Interrupt::SupervisorExternal => 9,
137-
Interrupt::Unknown => panic!("unknown interrupt"),
138-
} | (1 << (size_of::<usize>() * 8 - 1))), // interrupt bit is 1
130+
Trap::Interrupt(i) => {
131+
(match i {
132+
Interrupt::UserSoft => 0,
133+
Interrupt::SupervisorSoft => 1,
134+
Interrupt::UserTimer => 4,
135+
Interrupt::SupervisorTimer => 5,
136+
Interrupt::UserExternal => 8,
137+
Interrupt::SupervisorExternal => 9,
138+
Interrupt::Unknown => panic!("unknown interrupt"),
139+
} | (1 << (size_of::<usize>() * 8 - 1)))
140+
} // interrupt bit is 1
139141
Trap::Exception(e) => match e {
140142
Exception::InstructionMisaligned => 0,
141143
Exception::InstructionFault => 1,
@@ -149,7 +151,7 @@ pub unsafe fn set(cause: Trap) {
149151
Exception::LoadPageFault => 13,
150152
Exception::StorePageFault => 15,
151153
Exception::Unknown => panic!("unknown exception"),
152-
} // interrupt bit is 0
154+
}, // interrupt bit is 0
153155
};
154156
_write(bits);
155157
}

0 commit comments

Comments
 (0)