Skip to content

Commit

Permalink
get
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed May 14, 2024
1 parent f2417ea commit b6f45b0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions blockset-lib/src/app/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ fn set_progress(
state.set_progress(&(mb(progress_b) + ", "), progress_p)
}

pub fn get<T: Io>(io: &T, a: &mut T::Args) -> io::Result<()> {
let d = get_hash(a)?;
let path = posix_path(a.next().ok_or(invalid_input("missing file name"))?.as_str());
fn get_if(d: &U224, path: &str, io: &impl Io) -> io::Result<()> {
let mut state = StatusLine::new(io);
if path.ends_with('/') {
let mut buffer = Vec::default();
Expand Down Expand Up @@ -107,3 +105,11 @@ pub fn get<T: Io>(io: &T, a: &mut T::Args) -> io::Result<()> {
Ok(())
}
}

pub fn get<T: Io>(io: &T, a: &mut T::Args) -> io::Result<()> {
get_if(
&get_hash(a)?,
&posix_path(a.next().ok_or(invalid_input("missing file name"))?.as_str()),
io,
)
}

0 comments on commit b6f45b0

Please sign in to comment.