intermodal/src/outln.rs
Casey Rodarmor 5a1de1acd2
Select piece length when none is provided
When no piece length is provided to imdl torrent create, a piece
length is selected based on the size of the input. The hueristic is
lifted directly from libtorrent.

Also adds a imdl torrent piece-length command, which prints a table
of the piece lengths chosen at different content sizes, which is useful
for understanding and debugging the piece length selection algorithm.

type: added
2020-04-07 19:01:03 -07:00

12 lines
321 B
Rust

macro_rules! outln {
($env:expr) => {
writeln!($env.out, "").context(crate::error::Stderr)?;
};
($env:expr, $fmt:expr) => {
writeln!($env.out, $fmt).context(crate::error::Stderr)?;
};
($env:expr, $fmt:expr, $($arg:tt)*) => {
writeln!($env.out, $fmt, $($arg)*).context(crate::error::Stderr)?;
};
}