mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-03-15 03:00:49 +00:00
some reformatting
This commit is contained in:
parent
d8428327d5
commit
3e635514e4
@ -167,7 +167,11 @@ impl<T> RefList<T> {
|
|||||||
pub fn begin_insert_after<F>(&mut self, mut f: F) -> InsertTransaction<T>
|
pub fn begin_insert_after<F>(&mut self, mut f: F) -> InsertTransaction<T>
|
||||||
where F : FnMut(&T) -> bool
|
where F : FnMut(&T) -> bool
|
||||||
{
|
{
|
||||||
let pos = self.items.iter().position(|rf| f(&**rf.read())).map(|x| x + 1).unwrap_or(self.items.len());
|
let pos = self
|
||||||
|
.items.iter()
|
||||||
|
.position(|rf| f(&**rf.read())).map(|x| x + 1)
|
||||||
|
.unwrap_or(self.items.len());
|
||||||
|
|
||||||
self.begin_insert(pos)
|
self.begin_insert(pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +213,6 @@ impl<T> RefList<T> {
|
|||||||
detached.write().index = EntryOrigin::Detached;
|
detached.write().index = EntryOrigin::Detached;
|
||||||
total_removed += 1;
|
total_removed += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn done_insert(&mut self, index: usize, mut items: Vec<EntryRef<T>>) {
|
fn done_insert(&mut self, index: usize, mut items: Vec<EntryRef<T>>) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user