Skip to content

Commit

Permalink
Merge pull request #33 from EspressoSystems/nfy/access_static_version…
Browse files Browse the repository at this point in the history
…_instance

A convenience method for getting a bind_version
  • Loading branch information
nyospe authored Mar 14, 2024
2 parents 40d9678 + 2cf490f commit 6874f91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "versioned-binary-serialization"
version = "0.1.1"
version = "0.1.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
8 changes: 7 additions & 1 deletion src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ pub trait StaticVersionType: Sync + Send + Clone + Copy + Debug + private::Seale
minor: Self::MINOR,
}
}

fn instance() -> Self;
}

#[derive(Clone, Copy, Display)]
pub struct StaticVersion<const MAJOR: u16, const MINOR: u16>;
pub struct StaticVersion<const MAJOR: u16, const MINOR: u16> {}

impl<const MAJOR: u16, const MINOR: u16> StaticVersionType for StaticVersion<MAJOR, MINOR> {
const MAJOR: u16 = MAJOR;
Expand All @@ -59,6 +61,10 @@ impl<const MAJOR: u16, const MINOR: u16> StaticVersionType for StaticVersion<MAJ
minor: Self::MINOR,
}
}

fn instance() -> Self {
Self {}
}
}

impl<const MAJOR: u16, const MINOR: u16> Debug for StaticVersion<MAJOR, MINOR> {
Expand Down

0 comments on commit 6874f91

Please sign in to comment.