Commit 862babe2 authored by DCjanus's avatar DCjanus
Browse files

impl const fn method

parent ce3b3bb4
......@@ -15,12 +15,12 @@ macro_rules! impl_id {
impl $name {
/// Create a new id.
pub fn new(id: u64) -> Self {
pub const fn new(id: u64) -> Self {
$name(id)
}
/// The value of the id.
pub fn value(&self) -> u64 {
pub const fn value(&self) -> u64 {
self.0
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment