mirror of
https://github.com/TxtDot/dalet-rs.git
synced 2025-03-13 19:24:38 +03:00
feat: convert to typed from daletl
This commit is contained in:
parent
c121a53314
commit
5a42997045
8 changed files with 239 additions and 29 deletions
|
@ -8,13 +8,13 @@ pub fn encode(page: &DlPage) -> Result<Vec<u8>, DaletPackError> {
|
|||
}
|
||||
|
||||
pub fn encode_no_compress(page: &DlPage) -> Result<Vec<u8>, DaletPackError> {
|
||||
if page.len() > 2usize.pow(32) {
|
||||
if page.data.len() > 2usize.pow(32) {
|
||||
return Err(DaletPackError::PageMaxSizeExceeded);
|
||||
}
|
||||
|
||||
let mut bv: Vec<u8> = Vec::new();
|
||||
|
||||
for tag in page {
|
||||
for tag in &page.data {
|
||||
write_tag(&mut bv, tag)?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue