Skip to content

Commit

Permalink
make clippy happier
Browse files Browse the repository at this point in the history
  • Loading branch information
rklaehn committed Mar 19, 2024
1 parent c0f0414 commit 6f27031
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
18 changes: 13 additions & 5 deletions examples/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -179,12 +179,20 @@ fn parse_ranges(ranges: Vec<String>) -> anyhow::Result<RangeSet2<u64>> {
}

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 {
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f27031

Please sign in to comment.