style: cargo fmt kernel crates

This commit is contained in:
2026-10-26 19:07:54 +01:00
parent 818eaecadd
commit 1c04ddf909
50 changed files with 995 additions and 499 deletions

View File

@@ -95,15 +95,21 @@ impl EndpointTable {
}
pub fn get(&self, id: EndpointId) -> Option<&Endpoint> {
self.endpoints.get(id.raw() as usize).and_then(|s| s.as_ref())
self.endpoints
.get(id.raw() as usize)
.and_then(|s| s.as_ref())
}
pub fn get_mut(&mut self, id: EndpointId) -> Option<&mut Endpoint> {
self.endpoints.get_mut(id.raw() as usize).and_then(|s| s.as_mut())
self.endpoints
.get_mut(id.raw() as usize)
.and_then(|s| s.as_mut())
}
pub fn destroy(&mut self, id: EndpointId) -> Option<Endpoint> {
self.endpoints.get_mut(id.raw() as usize).and_then(|s| s.take())
self.endpoints
.get_mut(id.raw() as usize)
.and_then(|s| s.take())
}
pub fn remove_thread_from_all(&mut self, thread: ThreadId) {

View File

@@ -166,7 +166,11 @@ fn table_destroy_then_get_fails() {
fn table_get_mut_allows_enqueue() {
let mut table = EndpointTable::new();
let id = table.create().unwrap();
table.get_mut(id).unwrap().enqueue_sender(thread(1)).unwrap();
table
.get_mut(id)
.unwrap()
.enqueue_sender(thread(1))
.unwrap();
assert!(table.get(id).unwrap().has_waiting_sender());
}