Skip to content

Commit 86b6854

Browse files
committed
clean up more dependencies
1 parent 5adba32 commit 86b6854

5 files changed

Lines changed: 18 additions & 17 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ chrono = { version = "0.4", features = ["serde"] }
2424
clap = { version = "4", features = ["derive"] }
2525
debug-ignore = "1"
2626
derive-where = "1"
27-
either = "1"
2827
futures = "0.3"
2928
indent_write = "2"
3029
indexmap = { version = "2", features = ["serde"] }

crates/oxide-update-engine-types/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ schemars08 = ["dep:schemars", "newtype-uuid/schemars08"]
1919

2020
[dependencies]
2121
anyhow.workspace = true
22-
chrono.workspace = true
2322
derive-where.workspace = true
24-
either.workspace = true
2523
indexmap.workspace = true
2624
indent_write.workspace = true
2725
petgraph.workspace = true

crates/oxide-update-engine-types/src/buffer/imp.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use crate::{
1717
spec::{EngineSpec, NestedSpec},
1818
};
1919
use derive_where::derive_where;
20-
use either::Either;
2120
use indexmap::IndexMap;
2221
use petgraph::{prelude::*, visit::Walker};
2322
use std::{
@@ -1421,15 +1420,31 @@ impl<S: EngineSpec> StepStatus<S> {
14211420
///
14221421
/// Events are sorted by event index.
14231422
pub fn low_priority(&self) -> impl Iterator<Item = &StepEvent<S>> {
1423+
// Two-variant iterator to avoid boxing: one arm yields
1424+
// the stored events, the other yields nothing.
1425+
enum LowPriority<I> {
1426+
Some(I),
1427+
Empty,
1428+
}
1429+
impl<I: Iterator> Iterator for LowPriority<I> {
1430+
type Item = I::Item;
1431+
fn next(&mut self) -> Option<Self::Item> {
1432+
match self {
1433+
Self::Some(iter) => iter.next(),
1434+
Self::Empty => None,
1435+
}
1436+
}
1437+
}
1438+
14241439
match self {
14251440
Self::Running { low_priority, .. } => {
1426-
Either::Left(low_priority.iter())
1441+
LowPriority::Some(low_priority.iter())
14271442
}
14281443
Self::NotStarted
14291444
| Self::Completed { .. }
14301445
| Self::Failed { .. }
14311446
| Self::Aborted { .. }
1432-
| Self::WillNotBeRun { .. } => Either::Right(std::iter::empty()),
1447+
| Self::WillNotBeRun { .. } => LowPriority::Empty,
14331448
}
14341449
}
14351450

crates/oxide-update-engine/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ workspace = true
1818
schemars08 = ["oxide-update-engine-types/schemars08"]
1919

2020
[dependencies]
21-
anyhow.workspace = true
2221
cancel-safe-futures.workspace = true
2322
debug-ignore.workspace = true
2423
derive-where.workspace = true
2524
futures.workspace = true
2625
linear-map.workspace = true
2726
oxide-update-engine-types.workspace = true
28-
serde_json.workspace = true
2927
slog.workspace = true
3028
tokio.workspace = true
3129

0 commit comments

Comments
 (0)