# display.rs - source
Source of the Rust file `crates/core/src/display.rs`.

Skip to main content

#
tlsn_core/
display.rs

    1use rangeset::set::RangeSet;
    2
    3pub(crate) struct FmtRangeSet<'a>(pub &'a RangeSet<usize>);
    4
    5impl<'a> std::fmt::Display for FmtRangeSet<'a> {
    6    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    7        f.write_str("{")?;
    8        for range in self.0.iter() {
    9            write!(f, "{}..{}", range.start, range.end)?;
    10            if range.end < self.0.end().unwrap_or(0) {
    11                f.write_str(", ")?;
    12            }
    13        }
    14        f.write_str("}")
    15    }
    16}