Commit 10827048 authored by Ian Jackson's avatar Ian Jackson
Browse files

arti-dirauth: FilenameOrStdio: implement Debug for various types

parent f692c6a2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -371,6 +371,7 @@ dependencies = [
 "clap",
 "derive-deftly",
 "digest 0.10.7",
 "educe",
 "test-temp-dir",
 "thiserror 2.0.19",
 "tor-checkable",
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ anyhow = "1.0.72"
clap = { version = "4.3.24", features = ["string", "wrap_help", "derive"] }
derive-deftly = { version = "~1.11.4", features = ["full", "beta"] }
digest = "0.10.0"
educe = "0.4.22"
thiserror = "2"
tor-checkable = { path = "../tor-checkable", version = "0.45.0" }
tor-dirauth = { path = "../tor-dirauth", version = "0.45.0" }
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use std::time::SystemTime;
use anyhow::{Context as _, anyhow};
use derive_deftly::{Deftly, define_derive_deftly};
use digest::Digest as _;
use educe::Educe;

use tor_checkable::TimeBound as _;
use tor_dirauth::consensus;
+7 −0
Original line number Diff line number Diff line
@@ -67,8 +67,11 @@ pub(super) enum FilenameOrStdio {
/// Output file currently being read from
///
/// See [`FilenameOrStdio::start_reading`].
#[derive(Educe)]
#[educe(Debug)]
pub(super) struct Reading {
    /// Actual open-file
    #[educe(Debug(ignore))]
    handle: io::BufReader<Box<dyn io::Read>>,
    /// Description (for error messages), already quoted
    description: String,
@@ -77,14 +80,18 @@ pub(super) struct Reading {
/// Output file currently being written to
///
/// See [`FilenameOrStdio::start_writing`].
#[derive(Educe)]
#[educe(Debug)]
pub(super) struct Writing {
    /// Actual open-file
    #[educe(Debug(ignore))]
    handle: io::BufWriter<Box<dyn io::Write>>,
    /// Filenames
    files: Option<WritingFiles>,
}

/// Filenames when writing an output file
#[derive(Debug)]
struct WritingFiles {
    /// The `.tmp` file
    tmp: String,