mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-12-01 00:27:17 +00:00
22 lines
577 B
Rust
22 lines
577 B
Rust
use serde::{Serialize, Serializer};
|
|
|
|
use crate::RunProjection;
|
|
|
|
pub struct SerializableProjection<'a>(pub &'a RunProjection);
|
|
|
|
impl Serialize for SerializableProjection<'_> {
|
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
|
where
|
|
S: Serializer,
|
|
{
|
|
let mut projection = self.0.clone();
|
|
for (_, stage) in projection.iter_stages_mut() {
|
|
stage.prompt = None;
|
|
stage.response = None;
|
|
stage.diff = None;
|
|
stage.output = None;
|
|
}
|
|
|
|
projection.serialize(serializer)
|
|
}
|
|
}
|