Skip to content

Commit

Permalink
limit visibility of some types as rust-lang/rust#32409 is available i…
Browse files Browse the repository at this point in the history
…n 1.18
  • Loading branch information
niamster committed Jun 9, 2017
1 parent 4d348df commit a1f63ab
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
4 changes: 1 addition & 3 deletions src/handlers/stderr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ use std::ops::Deref;

use handlers::Handler;

// TODO: use pub(crate) when stabilized (should in v1.18)
// https://github.com/rust-lang/rust/issues/32409
#[doc(hidden)]
pub fn emit(formatted: &str) {
pub(crate) fn emit(formatted: &str) {
let stderr = io::stderr();
let mut stderr = stderr.lock();
let _ = stderr.write_all(formatted.as_bytes());
Expand Down
4 changes: 1 addition & 3 deletions src/handlers/stdout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ use std::ops::Deref;

use handlers::Handler;

// TODO: use pub(crate) when stabilized (should in v1.18)
// https://github.com/rust-lang/rust/issues/32409
#[doc(hidden)]
pub fn emit(formatted: &str) {
pub(crate) fn emit(formatted: &str) {
let stdout = io::stdout();
let mut stdout = stdout.lock();
let _ = stdout.write_all(formatted.as_bytes());
Expand Down
5 changes: 2 additions & 3 deletions src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ impl From<isize> for LogLevel {
}
}

// TODO: use pub(crate) when stabilized (should in v1.18)
// https://github.com/rust-lang/rust/issues/32409
// NOTE: `LOG` level should not be included here
#[cfg(test)]
#[doc(hidden)]
pub const LEVELS: [LogLevel; 8] = [
pub(crate) const LEVELS: [LogLevel; 8] = [
LogLevel::TRACE,
LogLevel::DEBUG,
LogLevel::VERBOSE,
Expand Down
12 changes: 3 additions & 9 deletions src/record/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,18 @@ impl RecordLazyMeta {
}
}

// TODO: use pub(crate) when stabilized (should in v1.18)
// https://github.com/rust-lang/rust/issues/32409
#[doc(hidden)]
pub struct SyncRecord<'a> {
pub(crate) struct SyncRecord<'a> {
irecord: &'static RecordMeta,
args: fmt::Arguments<'a>,
precord: Arc<RecordLazyMeta>,
ts: time::Timespec,
}

impl<'a> SyncRecord<'a> {
// TODO: use pub(crate) when stabilized (should in v1.18)
// https://github.com/rust-lang/rust/issues/32409
#[doc(hidden)]
#[inline(always)]
pub fn new(record: &'static RecordMeta,
pub(crate) fn new(record: &'static RecordMeta,
ts: time::Timespec,
args: fmt::Arguments<'a>,
formatter: Arc<Formatter>) -> Self {
Expand Down Expand Up @@ -193,10 +189,8 @@ impl<'a> Record for SyncRecord<'a> {
}
}

// TODO: use pub(crate) when stabilized (should in v1.18)
// https://github.com/rust-lang/rust/issues/32409
#[doc(hidden)]
pub struct AsyncRecord {
pub(crate) struct AsyncRecord {
irecord: &'static RecordMeta,
msg: Arc<String>,
precord: Arc<RecordLazyMeta>,
Expand Down
2 changes: 0 additions & 2 deletions src/record/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ pub trait Record: Send + Sync {
fn ts_utc(&self) -> Arc<DateTime<UTC>>;
}

// TODO: use pub(crate) when stabilized (should in v1.18)
// https://github.com/rust-lang/rust/issues/32409
#[doc(hidden)]
pub mod imp;

0 comments on commit a1f63ab

Please sign in to comment.