Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit bc614ae

Browse files
authored
Merge pull request #10 from dignifiedquire/fix/no-default-features
fix: ensure tests pass when using no-default-features
2 parents 7e92eda + d7f4166 commit bc614ae

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,17 @@ matrix:
1111
allow_failures:
1212
- rust: nightly
1313
fast_finish: true
14+
15+
script:
16+
- |
17+
if [ ${TRAVIS_RUST_VERSION} = "nightly" ]; then
18+
cargo build --verbose $ARGS --features "nightly";
19+
cargo test --verbose --features "nightly";
20+
cargo doc --verbose --features "nightly";
21+
fi
22+
- cargo build --verbose
23+
- cargo test --verbose
24+
- cargo doc --verbose
25+
- cargo build --verbose --no-default-features
26+
- cargo test --verbose --no-default-features
27+
- cargo doc --verbose --no-default-features

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ impl<W: Write> BufWriter<W> {
528528
/// enabled. The default capacity will differ between Windows and Unix-derivative targets.
529529
/// See [`Buffer::new_ringbuf()`](Buffer::new_ringbuf)
530530
/// or [the crate root docs](index.html#ringbuffers--slice-deque-feature) for more info.
531+
#[cfg(feature = "slice-deque")]
531532
pub fn new_ringbuf(inner: W) -> Self {
532533
Self::with_buffer(Buffer::new_ringbuf(), inner)
533534
}
@@ -544,6 +545,7 @@ impl<W: Write> BufWriter<W> {
544545
/// enabled. The capacity will be rounded up to the minimum size for the target platform.
545546
/// See [`Buffer::with_capacity_ringbuf()`](Buffer::with_capacity_ringbuf)
546547
/// or [the crate root docs](index.html#ringbuffers--slice-deque-feature) for more info.
548+
#[cfg(feature = "slice-deque")]
547549
pub fn with_capacity_ringbuf(cap: usize, inner: W) -> Self {
548550
Self::with_buffer(Buffer::with_capacity_ringbuf(cap), inner)
549551
}
@@ -749,11 +751,13 @@ impl<W: Write> LineWriter<W> {
749751
}
750752

751753
/// Wrap `inner` with the default buffer capacity using a ringbuffer.
754+
#[cfg(feature = "slice-deque")]
752755
pub fn new_ringbuf(inner: W) -> Self {
753756
Self::with_buffer(Buffer::new_ringbuf(), inner)
754757
}
755758

756759
/// Wrap `inner` with the given buffer capacity using a ringbuffer.
760+
#[cfg(feature = "slice-deque")]
757761
pub fn with_capacity_ringbuf(cap: usize, inner: W) -> Self {
758762
Self::with_buffer(Buffer::with_capacity_ringbuf(cap), inner)
759763
}

0 commit comments

Comments
 (0)