diff --git a/examples/cli.rs b/examples/cli.rs index 5128f76..3541814 100644 --- a/examples/cli.rs +++ b/examples/cli.rs @@ -17,14 +17,14 @@ //! will decode the encoded data in somefile.bao and write it to /dev/null, printing //! information about the decoding process to stderr. use std::{ - io::{self, Cursor, Write}, + io::{self, Cursor}, path::PathBuf, }; use anyhow::Context; use bao_tree::{ blake3, - io::{outboard::PreOrderMemOutboard, round_up_to_chunks, Header, Leaf, Parent}, + io::{outboard::PreOrderMemOutboard, round_up_to_chunks, Leaf, Parent}, BlockSize, ChunkNum, ChunkRanges, }; use bytes::Bytes; @@ -179,12 +179,20 @@ fn parse_ranges(ranges: Vec) -> anyhow::Result> { } mod sync { - use bao_tree::io::sync::{ - encode_ranges_validated, DecodeResponseItem, DecodeResponseIter, Outboard, + use std::io::{self, Cursor, Write}; + + use bao_tree::{ + io::{ + outboard::PreOrderMemOutboard, + round_up_to_chunks, + sync::{encode_ranges_validated, DecodeResponseItem, DecodeResponseIter, Outboard}, + Header, Leaf, Parent, + }, + BlockSize, ChunkRanges, }; use positioned_io::WriteAt; - use super::*; + use crate::{parse_ranges, Args, Command, DecodeArgs, EncodeArgs, Message}; /// Encode a part of a file, given the outboard. fn encode(data: &[u8], outboard: impl Outboard, ranges: ChunkRanges) -> Message { diff --git a/src/lib.rs b/src/lib.rs index b0abc96..6f655ca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -655,7 +655,8 @@ fn pre_order_offset_loop(node: u64, len: u64) -> u64 { /// Split a range set into range sets for the left and right half of a node /// /// Requires that the range set is minimal, it should not contain any redundant -/// boundaries outside of the range of the node. +/// boundaries outside of the range of the node. The values outside of the node +/// range don't matter, so any change outside the range must be omitted. /// /// Produces two range sets that are also minimal. A range set for left or right /// that covers the entire range of the node will be replaced with the set of