Skip to content

Commit

Permalink
rewrite debug impl
Browse files Browse the repository at this point in the history
  • Loading branch information
theaddonn committed Jun 30, 2024
1 parent 6a812a8 commit ebed5bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bedrock_core/src/version.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
use std::fmt::{Debug, Display, Formatter};

#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub struct Version {
major: u32,
minor: u32,
patch: u32,
build: u32,
}

impl Debug for Version {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}.{}.{}.{}", self.major, self.minor, self.patch, self.build)
}
}

impl Display for Version {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}.{}.{}", self.major, self.minor, self.patch)
Expand Down

0 comments on commit ebed5bc

Please sign in to comment.