mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 04:58:42 +00:00
Mark all internal types & fn as pub(crate)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
1c40848f51
commit
cc13a23b07
3 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ use tokio::{sync::mpsc, task::spawn_blocking};
|
||||||
use super::{extracter::*, readable_rx::*, AutoAbortJoinHandle};
|
use super::{extracter::*, readable_rx::*, AutoAbortJoinHandle};
|
||||||
use crate::{BinstallError, PkgFmt};
|
use crate::{BinstallError, PkgFmt};
|
||||||
|
|
||||||
pub enum Content {
|
pub(crate) enum Content {
|
||||||
/// Data to write to file
|
/// Data to write to file
|
||||||
Data(Bytes),
|
Data(Bytes),
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use crate::{BinstallError, PkgFmt};
|
||||||
/// Extract files from the specified source onto the specified path.
|
/// Extract files from the specified source onto the specified path.
|
||||||
///
|
///
|
||||||
/// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`.
|
/// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`.
|
||||||
pub fn extract_compressed_from_readable(
|
pub(crate) fn extract_compressed_from_readable(
|
||||||
dat: impl Read,
|
dat: impl Read,
|
||||||
fmt: PkgFmt,
|
fmt: PkgFmt,
|
||||||
path: &Path,
|
path: &Path,
|
||||||
|
@ -66,7 +66,7 @@ pub fn extract_compressed_from_readable(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> {
|
pub(crate) fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> {
|
||||||
debug!("Decompressing from zip archive to `{dst:?}`");
|
debug!("Decompressing from zip archive to `{dst:?}`");
|
||||||
|
|
||||||
let mut zip = ZipArchive::new(dat)?;
|
let mut zip = ZipArchive::new(dat)?;
|
||||||
|
|
|
@ -7,13 +7,13 @@ use tokio::sync::mpsc::Receiver;
|
||||||
use super::async_file_writer::Content;
|
use super::async_file_writer::Content;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ReadableRx<'a> {
|
pub(crate) struct ReadableRx<'a> {
|
||||||
rx: &'a mut Receiver<Content>,
|
rx: &'a mut Receiver<Content>,
|
||||||
bytes: Bytes,
|
bytes: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> ReadableRx<'a> {
|
impl<'a> ReadableRx<'a> {
|
||||||
pub fn new(rx: &'a mut Receiver<Content>) -> Self {
|
pub(crate) fn new(rx: &'a mut Receiver<Content>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
rx,
|
rx,
|
||||||
bytes: Bytes::new(),
|
bytes: Bytes::new(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue