Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A convenience method for getting a bind_version #33

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading