root page is u32
This commit is contained in:
parent
df0c43e56a
commit
dc7d7512a4
|
@ -62,12 +62,13 @@ impl<'a> ColumnValue<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn read_u8(&self) -> u8 {
|
||||
if let ColumnValue::U8(v) = self {
|
||||
*v
|
||||
} else {
|
||||
println!("{:?}", self);
|
||||
unreachable!()
|
||||
pub fn read_u32(&self) -> u32 {
|
||||
match self {
|
||||
ColumnValue::U8(v) => *v as u32,
|
||||
ColumnValue::U16(v) => *v as u32,
|
||||
ColumnValue::U24(v) => *v as u32,
|
||||
ColumnValue::U32(v) => *v as u32,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ pub struct Schema {
|
|||
pub kind: String,
|
||||
pub name: String,
|
||||
pub table_name: String,
|
||||
pub root_page: u8,
|
||||
pub root_page: u32,
|
||||
pub sql: String,
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ impl Schema {
|
|||
let kind = items.next()?.to_string();
|
||||
let name = items.next()?.to_string();
|
||||
let table_name = items.next()?.to_string();
|
||||
let root_page = items.next()?.read_u8();
|
||||
let root_page = items.next()?.read_u32();
|
||||
let sql = items.next()?.to_string();
|
||||
|
||||
let schema = Self {
|
||||
|
|
Loading…
Reference in New Issue
Block a user