core: Kill Many variant from IOCompletions enum

This commit is contained in:
Pekka Enberg
2025-10-13 10:58:52 +03:00
parent 5fb93b8780
commit af3a90bf4b
2 changed files with 0 additions and 20 deletions

View File

@@ -1633,9 +1633,6 @@ impl Pager {
IOCompletions::Single(c) => {
commit_info.completions.push(c);
}
IOCompletions::Many(c) => {
commit_info.completions.extend(c);
}
}
let mut group = CompletionGroup::new(|_| {});
for c in commit_info.completions.drain(..) {

View File

@@ -2349,7 +2349,6 @@ impl Cursor {
#[must_use]
pub enum IOCompletions {
Single(Completion),
Many(Vec<Completion>),
}
impl IOCompletions {
@@ -2357,26 +2356,12 @@ impl IOCompletions {
pub fn wait<I: ?Sized + IO>(self, io: &I) -> Result<()> {
match self {
IOCompletions::Single(c) => io.wait_for_completion(c),
IOCompletions::Many(completions) => {
let mut completions = completions.into_iter();
while let Some(c) = completions.next() {
let res = io.wait_for_completion(c);
if res.is_err() {
for c in completions {
c.abort();
}
return res;
}
}
Ok(())
}
}
}
pub fn finished(&self) -> bool {
match self {
IOCompletions::Single(c) => c.finished(),
IOCompletions::Many(completions) => completions.iter().all(|c| c.finished()),
}
}
@@ -2384,14 +2369,12 @@ impl IOCompletions {
pub fn abort(&self) {
match self {
IOCompletions::Single(c) => c.abort(),
IOCompletions::Many(completions) => completions.iter().for_each(|c| c.abort()),
}
}
pub fn get_error(&self) -> Option<CompletionError> {
match self {
IOCompletions::Single(c) => c.get_error(),
IOCompletions::Many(completions) => completions.iter().find_map(|c| c.get_error()),
}
}
}