capitol 0.5.1

Parse United States Congress legislative document citations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::error::Error;
use std::fmt::Display;

pub type Result<T> = std::result::Result<T, Error>;

pub(crate) struct DisplayOption<T>(pub(crate) Option<T>);

impl<T: Display> Display for DisplayOption<T> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        if let Some(ref val) = self.0 {
            write!(f, "{val}")
        } else {
            write!(f, "")
        }
    }
}