(output: &mut String, indent: usize, value: &EffectValueDto)
| 287 | } |
| 288 | |
| 289 | fn write_effect_value(output: &mut String, indent: usize, value: &EffectValueDto) { |
| 290 | match value { |
| 291 | EffectValueDto::Absent => write_key_value(output, indent, "kind", "absent"), |
| 292 | EffectValueDto::Digest { digest_kind, hash } => { |
| 293 | write_key_value(output, indent, "kind", "digest"); |
| 294 | write_key_value(output, indent, "digest_kind", digest_kind); |
| 295 | write_key_value(output, indent, "hash", hash); |
| 296 | } |
| 297 | EffectValueDto::File { file } => { |
| 298 | write_key_value(output, indent, "kind", "file"); |
| 299 | write_key_value(output, indent, "file_kind", &file.kind); |
| 300 | write_key_value(output, indent, "mode", &format!("{:o}", file.mode)); |
| 301 | write_key_value(output, indent, "content", &file.content); |
| 302 | } |
| 303 | EffectValueDto::GitObject { object } => { |
| 304 | write_key_value(output, indent, "kind", "git_object"); |
| 305 | write_git_object(output, indent, object); |
| 306 | } |
| 307 | EffectValueDto::GitRef { target } => { |
| 308 | write_key_value(output, indent, "kind", "git_ref"); |
| 309 | write_git_ref_target(output, indent, target); |
| 310 | } |
| 311 | EffectValueDto::GitIndex { index } => { |
| 312 | write_key_value(output, indent, "kind", "git_index"); |
| 313 | write_git_index(output, indent, index); |
| 314 | } |
| 315 | EffectValueDto::WorkingCopy { state } => { |
| 316 | write_key_value(output, indent, "kind", "working_copy"); |
| 317 | write_working_copy_state(output, indent, state); |
| 318 | } |
| 319 | EffectValueDto::Verification { hash } => { |
| 320 | write_key_value(output, indent, "kind", "verification"); |
| 321 | write_key_value(output, indent, "hash", hash); |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | fn write_receipt(output: &mut String, indent: usize, receipt: &EffectReceiptDto) { |
| 327 | writeln!(output, "{}- id: {}", spaces(indent), receipt.id).unwrap(); |
no test coverage detected