Skip to content

Commit ba1a173

Browse files
Return normal run schedule output instead of custom one
Dont return custom report, so that user output is same for custom runner as default one.
1 parent 9194ba8 commit ba1a173

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

src/scheduling.rs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use std::{
2-
collections::HashMap,
3-
sync::{Arc, Mutex},
4-
};
1+
use std::{collections::HashMap, sync::Mutex};
52

63
use egglog::{
74
ast::{Expr, Fact, Facts, Literal, ParseError},
@@ -199,35 +196,18 @@ impl ScheduleState {
199196
}
200197
}
201198

202-
#[derive(Debug, Clone)]
203-
struct RunExtendedScheduleOutput {
204-
reports: Vec<RunReport>,
205-
}
206-
207-
impl std::fmt::Display for RunExtendedScheduleOutput {
208-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
209-
writeln!(f, "Ran schedules:")?;
210-
for report in &self.reports {
211-
writeln!(f, "{}", report)?;
212-
}
213-
Ok(())
214-
}
215-
}
216-
217199
impl UserDefinedCommand for RunExtendedSchedule {
218200
fn update(
219201
&self,
220202
egraph: &mut egglog::EGraph,
221203
args: &[Expr],
222204
) -> Result<Option<CommandOutput>, egglog::Error> {
223205
let mut schedule = ScheduleState::new();
224-
let mut reports = Vec::new();
206+
let mut report = RunReport::default();
225207
for arg in args {
226-
reports.push(schedule.run(egraph, arg)?);
208+
report.union(schedule.run(egraph, arg)?);
227209
}
228-
Ok(Some(CommandOutput::UserDefined(Arc::new(
229-
RunExtendedScheduleOutput { reports },
230-
))))
210+
Ok(Some(CommandOutput::RunSchedule(report)))
231211
}
232212
}
233213

0 commit comments

Comments
 (0)