Skip to content

Commit

Permalink
Remove unnecessary pub(crate) exports
Browse files Browse the repository at this point in the history
Fix build for windows

Fix build for windows

Fix build for windows
  • Loading branch information
In-line authored and Byron committed Jul 16, 2021
1 parent a799ca8 commit 3d2456e
Show file tree
Hide file tree
Showing 23 changed files with 43 additions and 45 deletions.
2 changes: 1 addition & 1 deletion git-actor/src/immutable/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod decode {
IResult,
};

pub(crate) const SPACE: &[u8] = b" ";
const SPACE: &[u8] = b" ";

/// Parse a signature from the bytes input `i` using `nom`.
pub fn signature<'a, E: ParseError<&'a [u8]> + ContextError<&'a [u8]>>(
Expand Down
2 changes: 1 addition & 1 deletion git-actor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bstr::BString;
pub mod immutable;
mod signature;

pub(crate) const SPACE: &[u8; 1] = b" ";
const SPACE: &[u8; 1] = b" ";

/// A mutable signature is created by an actor at a certain time.
///
Expand Down
8 changes: 4 additions & 4 deletions git-commitgraph/src/graph/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Graph {

/// Access fundamentals
impl Graph {
pub(crate) fn lookup_by_id(&self, id: &git_hash::oid) -> Option<LookupByIdResult<'_>> {
fn lookup_by_id(&self, id: &git_hash::oid) -> Option<LookupByIdResult<'_>> {
let mut current_file_start = 0;
for file in &self.files {
if let Some(lex_pos) = file.lookup(id) {
Expand All @@ -67,7 +67,7 @@ impl Graph {
None
}

pub(crate) fn lookup_by_pos(&self, pos: graph::Position) -> LookupByPositionResult<'_> {
fn lookup_by_pos(&self, pos: graph::Position) -> LookupByPositionResult<'_> {
let mut remaining = pos.0;
for (file_index, file) in self.files.iter().enumerate() {
match remaining.checked_sub(file.num_commits()) {
Expand All @@ -86,14 +86,14 @@ impl Graph {
}

#[derive(Clone)]
pub(crate) struct LookupByIdResult<'a> {
struct LookupByIdResult<'a> {
pub file: &'a File,
pub graph_pos: graph::Position,
pub file_pos: file::Position,
}

#[derive(Clone)]
pub(crate) struct LookupByPositionResult<'a> {
struct LookupByPositionResult<'a> {
pub file: &'a File,
pub file_index: usize,
pub pos: file::Position,
Expand Down
4 changes: 2 additions & 2 deletions git-features/src/parallel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ pub fn optimize_chunk_size_and_thread_limit(

/// Always returns 1, available when the `parallel` feature toggle is unset.
#[cfg(not(feature = "parallel"))]
pub(crate) fn num_threads(_thread_limit: Option<usize>) -> usize {
fn num_threads(_thread_limit: Option<usize>) -> usize {
1
}

/// Returns the amount of threads the system can effectively use as the amount of its logical cores.
///
/// Only available with the `parallel` feature toggle set.
#[cfg(feature = "parallel")]
pub(crate) fn num_threads(thread_limit: Option<usize>) -> usize {
fn num_threads(thread_limit: Option<usize>) -> usize {
let logical_cores = || num_cpus::get();
thread_limit
.map(|l| if l == 0 { logical_cores() } else { l })
Expand Down
4 changes: 2 additions & 2 deletions git-features/src/zlib/stream/deflate/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ mod deflate_stream {
/// Provide streaming decompression using the `std::io::Read` trait.
/// If `std::io::BufReader` is used, an allocation for the input buffer will be performed.
struct InflateReader<R> {
pub(crate) inner: R,
pub(crate) decompressor: Decompress,
inner: R,
decompressor: Decompress,
}

impl<R> InflateReader<R>
Expand Down
2 changes: 1 addition & 1 deletion git-object/src/immutable/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::ByteSlice;

pub(crate) const NL: &[u8] = b"\n";
pub(crate) const SPACE: &[u8] = b" ";
pub(crate) const SPACE_OR_NL: &[u8] = b" \n";
const SPACE_OR_NL: &[u8] = b" \n";

pub(crate) fn any_header_field_multi_line<'a, E: ParseError<&'a [u8]> + ContextError<&'a [u8]>>(
i: &'a [u8],
Expand Down
4 changes: 2 additions & 2 deletions git-object/src/mutable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//! They either created using object [construction][Object] or by [deserializing existing objects][crate::immutable::Object::from_bytes()]
//! and converting these [into mutable copies][crate::immutable::Object::into_mutable()] for adjustments.

pub(crate) const NL: &[u8; 1] = b"\n";
pub(crate) const SPACE: &[u8; 1] = b" ";
const NL: &[u8; 1] = b"\n";
const SPACE: &[u8; 1] = b" ";

mod convert;
mod encode;
Expand Down
2 changes: 1 addition & 1 deletion git-odb/src/store/loose/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Store {
}
}

pub(crate) fn sha1_path(id: &git_hash::oid, mut root: PathBuf) -> PathBuf {
fn sha1_path(id: &git_hash::oid, mut root: PathBuf) -> PathBuf {
match id.kind() {
git_hash::Kind::Sha1 => {
let hex = id.to_sha1_hex();
Expand Down
4 changes: 2 additions & 2 deletions git-pack/src/index/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct Entry {

/// Iteration and access
impl index::File {
pub(crate) fn iter_v1(&self) -> impl Iterator<Item = Entry> + '_ {
fn iter_v1(&self) -> impl Iterator<Item = Entry> + '_ {
match self.version {
index::Version::V1 => self.data[V1_HEADER_SIZE..]
.chunks(N32_SIZE + SHA1_SIZE)
Expand All @@ -45,7 +45,7 @@ impl index::File {
}
}

pub(crate) fn iter_v2(&self) -> impl Iterator<Item = Entry> + '_ {
fn iter_v2(&self) -> impl Iterator<Item = Entry> + '_ {
let pack64_offset = self.offset_pack_offset64_v2();
match self.version {
index::Version::V2 => izip!(
Expand Down
4 changes: 2 additions & 2 deletions git-pack/src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const FAN_LEN: usize = 256;

/// A representation of a pack index file
pub struct File {
pub(crate) data: FileBuffer,
data: FileBuffer,
path: std::path::PathBuf,
version: Version,
num_objects: u32,
Expand Down Expand Up @@ -135,7 +135,7 @@ pub use access::Entry;

///
pub mod traverse;
pub(crate) mod util;
mod util;
///
pub mod verify;
///
Expand Down
8 changes: 4 additions & 4 deletions git-pack/src/index/traverse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod indexed;
mod reduce;
///
pub mod with_lookup;
pub(crate) use reduce::Reducer;
use reduce::Reducer;

mod error;
pub use error::Error;
Expand Down Expand Up @@ -116,7 +116,7 @@ impl index::File {
.map(|(a, b, p)| (a, b, p.into_inner()))
}

pub(crate) fn possibly_verify<E>(
fn possibly_verify<E>(
&self,
pack: &crate::data::File,
check: SafetyCheck,
Expand Down Expand Up @@ -149,7 +149,7 @@ impl index::File {
}

#[allow(clippy::too_many_arguments)]
pub(crate) fn decode_and_process_entry<C, P, E>(
fn decode_and_process_entry<C, P, E>(
&self,
check: SafetyCheck,
pack: &crate::data::File,
Expand Down Expand Up @@ -201,7 +201,7 @@ impl index::File {
}

#[allow(clippy::too_many_arguments)]
pub(crate) fn process_entry<P, E>(
fn process_entry<P, E>(
check: SafetyCheck,
object_kind: git_object::Kind,
decompressed: &[u8],
Expand Down
2 changes: 1 addition & 1 deletion git-pack/src/index/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl index::File {
}

#[allow(clippy::too_many_arguments)]
pub(crate) fn verify_entry<P>(
fn verify_entry<P>(
mode: Mode,
encode_buf: &mut Vec<u8>,
object_kind: git_object::Kind,
Expand Down
2 changes: 1 addition & 1 deletion git-pack/src/tree/traverse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ where
}
}

pub(crate) struct Reducer<'a, P> {
struct Reducer<'a, P> {
item_count: usize,
progress: &'a parking_lot::Mutex<P>,
start: std::time::Instant,
Expand Down
14 changes: 7 additions & 7 deletions git-packetline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//! For reading the packet line format use the [`StreamingPeekableIter`], and for writing the `Writer`.
#![deny(unsafe_code, rust_2018_idioms, missing_docs)]

pub(crate) const U16_HEX_BYTES: usize = 4;
pub(crate) const MAX_DATA_LEN: usize = 65516;
pub(crate) const MAX_LINE_LEN: usize = MAX_DATA_LEN + U16_HEX_BYTES;
pub(crate) const FLUSH_LINE: &[u8] = b"0000";
pub(crate) const DELIMITER_LINE: &[u8] = b"0001";
pub(crate) const RESPONSE_END_LINE: &[u8] = b"0002";
pub(crate) const ERR_PREFIX: &[u8] = b"ERR ";
const U16_HEX_BYTES: usize = 4;
const MAX_DATA_LEN: usize = 65516;
const MAX_LINE_LEN: usize = MAX_DATA_LEN + U16_HEX_BYTES;
const FLUSH_LINE: &[u8] = b"0000";
const DELIMITER_LINE: &[u8] = b"0001";
const RESPONSE_END_LINE: &[u8] = b"0002";
const ERR_PREFIX: &[u8] = b"ERR ";

/// One of three side-band types allowing to multiplex information over a single connection.
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
Expand Down
2 changes: 1 addition & 1 deletion git-packetline/src/write/blocking_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::io;
pub struct Writer<T> {
/// the `Write` implementation to which to propagate packet lines
inner: T,
pub(crate) binary: bool,
binary: bool,
}

impl<T: io::Write> Writer<T> {
Expand Down
4 changes: 1 addition & 3 deletions git-ref/src/store/file/log/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ pub mod decode {
}
}

pub(crate) fn one<'a, E: ParseError<&'a [u8]> + ContextError<&'a [u8]>>(
bytes: &'a [u8],
) -> IResult<&[u8], Line<'a>, E> {
fn one<'a, E: ParseError<&'a [u8]> + ContextError<&'a [u8]>>(bytes: &'a [u8]) -> IResult<&[u8], Line<'a>, E> {
let (i, (old, new, signature, message_sep, message)) = context(
"<old-hexsha> <new-hexsha> <name> <<email>> <timestamp> <tz>\\t<message>",
tuple((
Expand Down
4 changes: 2 additions & 2 deletions git-tempfile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub use fs::{create_dir, remove_dir};
pub mod handler;

mod forksafe;
pub(crate) use forksafe::ForksafeTempfile;
use forksafe::ForksafeTempfile;

pub mod handle;
use crate::handle::{Closed, Writable};
Expand Down Expand Up @@ -119,7 +119,7 @@ pub enum AutoRemove {
}

impl AutoRemove {
pub(crate) fn execute_best_effort(self, directory_to_potentially_delete: &Path) -> Option<PathBuf> {
fn execute_best_effort(self, directory_to_potentially_delete: &Path) -> Option<PathBuf> {
match self {
AutoRemove::Tempfile => None,
AutoRemove::TempfileAndEmptyParentDirectoriesUntil { boundary_directory } => {
Expand Down
4 changes: 2 additions & 2 deletions git-transport/src/client/async_io/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pin_project! {
pub struct RequestWriter<'a> {
on_into_read: MessageKind,
#[pin]
pub(crate) writer: git_packetline::Writer<Box<dyn AsyncWrite + Unpin + 'a>>,
pub(crate) reader: Box<dyn ExtendedBufRead + Unpin + 'a>,
writer: git_packetline::Writer<Box<dyn AsyncWrite + Unpin + 'a>>,
reader: Box<dyn ExtendedBufRead + Unpin + 'a>,
}
}
impl<'a> futures_io::AsyncWrite for RequestWriter<'a> {
Expand Down
2 changes: 1 addition & 1 deletion git-transport/src/client/blocking_io/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl SpawnProcessOnDemand {
desired_version: version,
}
}
pub(crate) fn new_local(path: BString, version: Protocol) -> SpawnProcessOnDemand {
fn new_local(path: BString, version: Protocol) -> SpawnProcessOnDemand {
SpawnProcessOnDemand {
url: git_url::Url {
scheme: git_url::Scheme::File,
Expand Down
2 changes: 1 addition & 1 deletion git-transport/src/client/blocking_io/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
};

#[cfg(feature = "http-client-curl")]
pub(crate) mod curl;
mod curl;

///
mod traits;
Expand Down
4 changes: 2 additions & 2 deletions git-transport/src/client/blocking_io/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::io;
/// obtaining the response.
pub struct RequestWriter<'a> {
on_into_read: MessageKind,
pub(crate) writer: git_packetline::Writer<Box<dyn io::Write + 'a>>,
pub(crate) reader: Box<dyn ExtendedBufRead + Unpin + 'a>,
writer: git_packetline::Writer<Box<dyn io::Write + 'a>>,
reader: Box<dyn ExtendedBufRead + Unpin + 'a>,
}

impl<'a> io::Write for RequestWriter<'a> {
Expand Down
2 changes: 1 addition & 1 deletion git-transport/src/client/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<R, W> Connection<R, W> {
}
}

pub(crate) mod message {
mod message {
use crate::{Protocol, Service};
use bstr::{BString, ByteVec};

Expand Down
2 changes: 1 addition & 1 deletion git-transport/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub mod capabilities;
#[doc(inline)]
pub use capabilities::Capabilities;

pub(crate) mod non_io_types;
mod non_io_types;
pub use non_io_types::{Error, Identity, MessageKind, WriteMode};

///
Expand Down

0 comments on commit 3d2456e

Please sign in to comment.