Mark all internal types & fn as pub(crate)

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-09 12:58:39 +10:00
parent 1c40848f51
commit cc13a23b07
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
3 changed files with 5 additions and 5 deletions

View file

@ -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),

View file

@ -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)?;

View file

@ -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(),