fix: cache calculation

This commit is contained in:
2026-04-15 17:31:39 +08:00
parent 365ceac3be
commit ff316c6873
23 changed files with 500 additions and 336 deletions

View File

@@ -12,7 +12,9 @@ pub struct RoutingLogWriter {
impl RoutingLogWriter {
pub fn create<P: AsRef<Path>>(path: P) -> Result<Self> {
let f = File::create(path)?;
Ok(Self { inner: BufWriter::new(f) })
Ok(Self {
inner: BufWriter::new(f),
})
}
pub fn write(&mut self, decision: &RouteDecision) -> Result<()> {

View File

@@ -19,7 +19,9 @@ pub struct TimeseriesWriter {
impl TimeseriesWriter {
pub fn create<P: AsRef<Path>>(path: P) -> Result<Self> {
let f = std::fs::File::create(path)?;
Ok(Self { inner: csv::Writer::from_writer(f) })
Ok(Self {
inner: csv::Writer::from_writer(f),
})
}
pub fn write(&mut self, row: &TimeseriesRow) -> Result<()> {