Skip to content

Commit

Permalink
2024/10/30-19:58:40 (Linux VDI0092.zit.bam.de x86_64)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbenner committed Oct 30, 2024
1 parent 73bf1c5 commit be471eb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ impl PartialEq for Range {
/* -------------------------------------------------------------------------- */

impl fmt::Display for Range {
/// Formats the `Range` as a string for display.
///
/// The format used is `[from, to)`, where `from` is inclusive and `to` is exclusive.
///
/// # Examples
///
/// ```
/// use rustynetics::range::Range;
///
/// let range = Range::new(5, 10);
/// println!("{}", range); // Output: [5, 10)
/// ```
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad(&format!("[{}, {})", self.from, self.to))
}
Expand Down

0 comments on commit be471eb

Please sign in to comment.