style: cargo fmt kernel crates
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user