mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 01:42:55 +00:00
libs: implement Generation Into<u32>
This commit is contained in:
@@ -89,6 +89,14 @@ impl Generation {
|
||||
Self::Broken => panic!("Attempted to use a broken generation"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into(self) -> Option<u32> {
|
||||
if let Self::Valid(v) = self {
|
||||
Some(v)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for Generation {
|
||||
|
||||
Reference in New Issue
Block a user