|
17 | 17 | //! will decode the encoded data in somefile.bao and write it to /dev/null, printing
|
18 | 18 | //! information about the decoding process to stderr.
|
19 | 19 | use std::{
|
20 |
| - io::{self, Cursor, Write}, |
| 20 | + io::{self, Cursor}, |
21 | 21 | path::PathBuf,
|
22 | 22 | };
|
23 | 23 |
|
24 | 24 | use anyhow::Context;
|
25 | 25 | use bao_tree::{
|
26 | 26 | blake3,
|
27 |
| - io::{outboard::PreOrderMemOutboard, round_up_to_chunks, Header, Leaf, Parent}, |
| 27 | + io::{outboard::PreOrderMemOutboard, round_up_to_chunks, Leaf, Parent}, |
28 | 28 | BlockSize, ChunkNum, ChunkRanges,
|
29 | 29 | };
|
30 | 30 | use bytes::Bytes;
|
@@ -179,12 +179,20 @@ fn parse_ranges(ranges: Vec<String>) -> anyhow::Result<RangeSet2<u64>> {
|
179 | 179 | }
|
180 | 180 |
|
181 | 181 | mod sync {
|
182 |
| - use bao_tree::io::sync::{ |
183 |
| - encode_ranges_validated, DecodeResponseItem, DecodeResponseIter, Outboard, |
| 182 | + use std::io::{self, Cursor, Write}; |
| 183 | + |
| 184 | + use bao_tree::{ |
| 185 | + io::{ |
| 186 | + outboard::PreOrderMemOutboard, |
| 187 | + round_up_to_chunks, |
| 188 | + sync::{encode_ranges_validated, DecodeResponseItem, DecodeResponseIter, Outboard}, |
| 189 | + Header, Leaf, Parent, |
| 190 | + }, |
| 191 | + BlockSize, ChunkRanges, |
184 | 192 | };
|
185 | 193 | use positioned_io::WriteAt;
|
186 | 194 |
|
187 |
| - use super::*; |
| 195 | + use crate::{parse_ranges, Args, Command, DecodeArgs, EncodeArgs, Message}; |
188 | 196 |
|
189 | 197 | /// Encode a part of a file, given the outboard.
|
190 | 198 | fn encode(data: &[u8], outboard: impl Outboard, ranges: ChunkRanges) -> Message {
|
|
0 commit comments