Skip to content

Commit b978018

Browse files
taiki-ecramertj
authored andcommitted
Unify case convention for feature names
1 parent 5eaf178 commit b978018

File tree

20 files changed

+56
-56
lines changed

20 files changed

+56
-56
lines changed

.travis.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ matrix:
1818
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
1919
# Check default-features
2020
- cargo build --all
21-
# Check compat & threadpool features
21+
# Check compat & thread-pool features
2222
- cargo build --manifest-path futures/Cargo.toml --features io-compat
23-
- cargo build --manifest-path futures/Cargo.toml --features threadpool
23+
- cargo build --manifest-path futures/Cargo.toml --features thread-pool
2424

2525
# This is the minimum Rust version supported by `async-await` feature.
2626
# When updating this, the reminder to update the minimum required version of `async-await` feature in README.md.
@@ -36,19 +36,19 @@ matrix:
3636
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
3737
# Check default-features
3838
- cargo build --all
39-
# Check compat & threadpool features
39+
# Check compat & thread-pool features
4040
- cargo build --manifest-path futures/Cargo.toml --features io-compat
41-
- cargo build --manifest-path futures/Cargo.toml --features threadpool
41+
- cargo build --manifest-path futures/Cargo.toml --features thread-pool
4242

4343
- name: cargo +beta build
4444
rust: beta
4545
script:
4646
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
4747
# Check default-features
4848
- cargo build --all
49-
# Check compat & threadpool & async-await features
49+
# Check compat & thread-pool & async-await features
5050
- cargo build --manifest-path futures/Cargo.toml --features io-compat
51-
- cargo build --manifest-path futures/Cargo.toml --features threadpool
51+
- cargo build --manifest-path futures/Cargo.toml --features thread-pool
5252
- cargo build --manifest-path futures/Cargo.toml --features async-await
5353

5454
- name: cargo test
@@ -153,7 +153,7 @@ matrix:
153153
- cargo check --manifest-path futures-io/Cargo.toml
154154
- cargo check --manifest-path futures-io/Cargo.toml --all-features
155155
# Check each features
156-
- cargo check --manifest-path futures-io/Cargo.toml --features read_initializer,unstable
156+
- cargo check --manifest-path futures-io/Cargo.toml --features read-initializer,unstable
157157

158158
# futures-util
159159
# Check default-features, all-features
@@ -173,7 +173,7 @@ matrix:
173173
- cargo check --manifest-path futures-util/Cargo.toml --features sink,bilock,unstable
174174
- cargo check --manifest-path futures-util/Cargo.toml --features io,bilock,unstable
175175
- cargo check --manifest-path futures-util/Cargo.toml --features sink,io
176-
- cargo check --manifest-path futures-util/Cargo.toml --features read_initializer,unstable
176+
- cargo check --manifest-path futures-util/Cargo.toml --features read-initializer,unstable
177177
# Check each features with --no-default-features
178178
- cargo check --manifest-path futures-util/Cargo.toml --no-default-features
179179
- cargo check --manifest-path futures-util/Cargo.toml --no-default-features --features sink
@@ -188,7 +188,7 @@ matrix:
188188
- cargo check --manifest-path futures-executor/Cargo.toml
189189
- cargo check --manifest-path futures-executor/Cargo.toml --all-features
190190
# Check each features
191-
- cargo check --manifest-path futures-executor/Cargo.toml --features threadpool
191+
- cargo check --manifest-path futures-executor/Cargo.toml --features thread-pool
192192

193193
- name: cargo doc
194194
rust: nightly

futures-executor/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name = "futures_executor"
1717
[features]
1818
default = ["std"]
1919
std = ["futures-core-preview/std", "futures-util-preview/std"]
20-
threadpool = ["num_cpus"]
20+
thread-pool = ["num_cpus"]
2121

2222
[dependencies]
2323
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.19", default-features = false }

futures-executor/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ mod local_pool;
1919
#[cfg(feature = "std")]
2020
pub use crate::local_pool::{block_on, block_on_stream, BlockingStream, LocalPool, LocalSpawner};
2121

22-
#[cfg(feature = "threadpool")]
22+
#[cfg(feature = "thread-pool")]
2323
#[cfg(feature = "std")]
2424
mod unpark_mutex;
25-
#[cfg(feature = "threadpool")]
25+
#[cfg(feature = "thread-pool")]
2626
#[cfg(feature = "std")]
2727
mod thread_pool;
28-
#[cfg(feature = "threadpool")]
28+
#[cfg(feature = "thread-pool")]
2929
#[cfg(feature = "std")]
3030
pub use crate::thread_pool::{ThreadPool, ThreadPoolBuilder};
3131

futures-executor/src/thread_pool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ use std::thread;
2121
/// This type is a clonable handle to the threadpool itself.
2222
/// Cloning it will only create a new reference, not a new threadpool.
2323
///
24-
/// This type is only available when the `threadpool` feature of this
24+
/// This type is only available when the `thread-pool` feature of this
2525
/// library is activated.
2626
pub struct ThreadPool {
2727
state: Arc<PoolState>,
2828
}
2929

3030
/// Thread pool configuration object.
3131
///
32-
/// This type is only available when the `threadpool` feature of this
32+
/// This type is only available when the `thread-pool` feature of this
3333
/// library is activated.
3434
pub struct ThreadPoolBuilder {
3535
pool_size: usize,

futures-io/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ std = []
2222
# These features are outside of the normal semver guarantees and require the
2323
# `unstable` feature as an explicit opt-in to unstable API.
2424
unstable = []
25-
read_initializer = []
25+
read-initializer = []
2626

2727
[dependencies]

futures-io/src/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! All items of this library are only available when the `std` feature of this
99
//! library is activated, and it is activated by default.
1010
11-
#![cfg_attr(feature = "read_initializer", feature(read_initializer))]
11+
#![cfg_attr(feature = "read-initializer", feature(read_initializer))]
1212

1313
#![cfg_attr(not(feature = "std"), no_std)]
1414

@@ -21,8 +21,8 @@
2121

2222
#![doc(html_root_url = "https://docs.rs/futures-io-preview/0.3.0-alpha.19")]
2323

24-
#[cfg(all(feature = "read_initializer", not(feature = "unstable")))]
25-
compile_error!("The `read_initializer` feature requires the `unstable` feature as an explicit opt-in to unstable features");
24+
#[cfg(all(feature = "read-initializer", not(feature = "unstable")))]
25+
compile_error!("The `read-initializer` feature requires the `unstable` feature as an explicit opt-in to unstable features");
2626

2727
#[cfg(feature = "std")]
2828
mod if_std {
@@ -43,7 +43,7 @@ mod if_std {
4343
SeekFrom as SeekFrom,
4444
};
4545

46-
#[cfg(feature = "read_initializer")]
46+
#[cfg(feature = "read-initializer")]
4747
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411
4848
pub use io::Initializer as Initializer;
4949

@@ -66,7 +66,7 @@ mod if_std {
6666
/// This method is `unsafe` because and `AsyncRead`er could otherwise
6767
/// return a non-zeroing `Initializer` from another `AsyncRead` type
6868
/// without an `unsafe` block.
69-
#[cfg(feature = "read_initializer")]
69+
#[cfg(feature = "read-initializer")]
7070
#[inline]
7171
unsafe fn initializer(&self) -> Initializer {
7272
Initializer::zeroing()
@@ -310,7 +310,7 @@ mod if_std {
310310

311311
macro_rules! deref_async_read {
312312
() => {
313-
#[cfg(feature = "read_initializer")]
313+
#[cfg(feature = "read-initializer")]
314314
unsafe fn initializer(&self) -> Initializer {
315315
(**self).initializer()
316316
}
@@ -342,7 +342,7 @@ mod if_std {
342342
P: DerefMut + Unpin,
343343
P::Target: AsyncRead,
344344
{
345-
#[cfg(feature = "read_initializer")]
345+
#[cfg(feature = "read-initializer")]
346346
unsafe fn initializer(&self) -> Initializer {
347347
(**self).initializer()
348348
}
@@ -362,7 +362,7 @@ mod if_std {
362362

363363
macro_rules! delegate_async_read_to_stdio {
364364
() => {
365-
#[cfg(feature = "read_initializer")]
365+
#[cfg(feature = "read-initializer")]
366366
unsafe fn initializer(&self) -> Initializer {
367367
io::Read::initializer(self)
368368
}

futures-util/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ channel = ["std", "futures-channel-preview"]
3232
unstable = ["futures-core-preview/unstable"]
3333
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic"]
3434
bilock = []
35-
read_initializer = ["io", "futures-io-preview/read_initializer", "futures-io-preview/unstable"]
35+
read-initializer = ["io", "futures-io-preview/read-initializer", "futures-io-preview/unstable"]
3636

3737
[dependencies]
3838
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.19", default-features = false }

futures-util/src/compat/compat01as03.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ unsafe impl UnsafeNotify01 for NotifyWaker {
368368
#[cfg(feature = "io-compat")]
369369
mod io {
370370
use super::*;
371-
#[cfg(feature = "read_initializer")]
371+
#[cfg(feature = "read-initializer")]
372372
use futures_io::Initializer;
373373
use futures_io::{AsyncRead as AsyncRead03, AsyncWrite as AsyncWrite03};
374374
use std::io::Error;
@@ -433,7 +433,7 @@ mod io {
433433
impl<W: AsyncWrite01> AsyncWrite01CompatExt for W {}
434434

435435
impl<R: AsyncRead01> AsyncRead03 for Compat01As03<R> {
436-
#[cfg(feature = "read_initializer")]
436+
#[cfg(feature = "read-initializer")]
437437
unsafe fn initializer(&self) -> Initializer {
438438
// check if `prepare_uninitialized_buffer` needs zeroing
439439
if self.inner.get_ref().prepare_uninitialized_buffer(&mut [1]) {

futures-util/src/compat/compat03as01.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ mod io {
262262
}
263263

264264
impl<R: AsyncRead03 + Unpin> AsyncRead01 for Compat<R> {
265-
#[cfg(feature = "read_initializer")]
265+
#[cfg(feature = "read-initializer")]
266266
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [u8]) -> bool {
267267
let initializer = self.inner.initializer();
268268
let does_init = initializer.should_initialize();

futures-util/src/future/either.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ mod if_std {
160160
use super::Either;
161161
use core::pin::Pin;
162162
use core::task::{Context, Poll};
163-
#[cfg(feature = "read_initializer")]
163+
#[cfg(feature = "read-initializer")]
164164
use futures_io::Initializer;
165165
use futures_io::{
166166
AsyncBufRead, AsyncRead, AsyncSeek, AsyncWrite, IoSlice, IoSliceMut, Result, SeekFrom,
@@ -171,7 +171,7 @@ mod if_std {
171171
A: AsyncRead,
172172
B: AsyncRead,
173173
{
174-
#[cfg(feature = "read_initializer")]
174+
#[cfg(feature = "read-initializer")]
175175
unsafe fn initializer(&self) -> Initializer {
176176
match self {
177177
Either::Left(x) => x.initializer(),

futures-util/src/io/allow_std.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use futures_core::task::{Context, Poll};
2-
#[cfg(feature = "read_initializer")]
2+
#[cfg(feature = "read-initializer")]
33
use futures_io::Initializer;
44
use futures_io::{AsyncRead, AsyncWrite, AsyncSeek, AsyncBufRead, IoSlice, IoSliceMut, SeekFrom};
55
use std::{fmt, io};
@@ -108,7 +108,7 @@ impl<T> io::Read for AllowStdIo<T> where T: io::Read {
108108
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
109109
self.0.read_vectored(bufs)
110110
}
111-
#[cfg(feature = "read_initializer")]
111+
#[cfg(feature = "read-initializer")]
112112
unsafe fn initializer(&self) -> Initializer {
113113
self.0.initializer()
114114
}
@@ -136,7 +136,7 @@ impl<T> AsyncRead for AllowStdIo<T> where T: io::Read {
136136
Poll::Ready(Ok(try_with_interrupt!(self.0.read_vectored(bufs))))
137137
}
138138

139-
#[cfg(feature = "read_initializer")]
139+
#[cfg(feature = "read-initializer")]
140140
unsafe fn initializer(&self) -> Initializer {
141141
self.0.initializer()
142142
}

futures-util/src/io/buf_reader.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use futures_core::task::{Context, Poll};
2-
#[cfg(feature = "read_initializer")]
2+
#[cfg(feature = "read-initializer")]
33
use futures_io::Initializer;
44
use futures_io::{AsyncBufRead, AsyncRead, AsyncSeek, IoSliceMut, SeekFrom};
55
use pin_utils::{unsafe_pinned, unsafe_unpinned};
@@ -168,7 +168,7 @@ impl<R: AsyncRead> AsyncRead for BufReader<R> {
168168
}
169169

170170
// we can't skip unconditionally because of the large buffer case in read.
171-
#[cfg(feature = "read_initializer")]
171+
#[cfg(feature = "read-initializer")]
172172
unsafe fn initializer(&self) -> Initializer {
173173
self.inner.initializer()
174174
}

futures-util/src/io/chain.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use futures_core::task::{Context, Poll};
2-
#[cfg(feature = "read_initializer")]
2+
#[cfg(feature = "read-initializer")]
33
use futures_io::Initializer;
44
use futures_io::{AsyncBufRead, AsyncRead, IoSliceMut};
55
use pin_utils::{unsafe_pinned, unsafe_unpinned};
@@ -119,7 +119,7 @@ where
119119
self.second().poll_read_vectored(cx, bufs)
120120
}
121121

122-
#[cfg(feature = "read_initializer")]
122+
#[cfg(feature = "read-initializer")]
123123
unsafe fn initializer(&self) -> Initializer {
124124
let initializer = self.first.initializer();
125125
if initializer.should_initialize() {

futures-util/src/io/empty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use futures_core::task::{Context, Poll};
2-
#[cfg(feature = "read_initializer")]
2+
#[cfg(feature = "read-initializer")]
33
use futures_io::Initializer;
44
use futures_io::{AsyncBufRead, AsyncRead};
55
use std::fmt;
@@ -44,7 +44,7 @@ impl AsyncRead for Empty {
4444
Poll::Ready(Ok(0))
4545
}
4646

47-
#[cfg(feature = "read_initializer")]
47+
#[cfg(feature = "read-initializer")]
4848
#[inline]
4949
unsafe fn initializer(&self) -> Initializer {
5050
Initializer::nop()

futures-util/src/io/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub use futures_io::{
1717
AsyncRead, AsyncWrite, AsyncSeek, AsyncBufRead, Error, ErrorKind,
1818
IoSlice, IoSliceMut, Result, SeekFrom,
1919
};
20-
#[cfg(feature = "read_initializer")]
20+
#[cfg(feature = "read-initializer")]
2121
pub use futures_io::Initializer;
2222

2323
// used by `BufReader` and `BufWriter`
@@ -26,10 +26,10 @@ const DEFAULT_BUF_SIZE: usize = 8 * 1024;
2626

2727
/// Initializes a buffer if necessary.
2828
///
29-
/// A buffer is always initialized if `read_initializer` feature is disabled.
29+
/// A buffer is always initialized if `read-initializer` feature is disabled.
3030
#[inline]
3131
unsafe fn initialize<R: AsyncRead>(_reader: &R, buf: &mut [u8]) {
32-
#[cfg(feature = "read_initializer")]
32+
#[cfg(feature = "read-initializer")]
3333
{
3434
if !_reader.initializer().should_initialize() {
3535
return;

futures-util/src/io/repeat.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use futures_core::task::{Context, Poll};
2-
#[cfg(feature = "read_initializer")]
2+
#[cfg(feature = "read-initializer")]
33
use futures_io::Initializer;
44
use futures_io::{AsyncRead, IoSliceMut};
55
use std::fmt;
@@ -59,7 +59,7 @@ impl AsyncRead for Repeat {
5959
Poll::Ready(Ok(nwritten))
6060
}
6161

62-
#[cfg(feature = "read_initializer")]
62+
#[cfg(feature = "read-initializer")]
6363
#[inline]
6464
unsafe fn initializer(&self) -> Initializer {
6565
Initializer::nop()

futures-util/src/io/take.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use futures_core::task::{Context, Poll};
2-
#[cfg(feature = "read_initializer")]
2+
#[cfg(feature = "read-initializer")]
33
use futures_io::Initializer;
44
use futures_io::{AsyncRead, AsyncBufRead};
55
use pin_utils::{unsafe_pinned, unsafe_unpinned};
@@ -185,7 +185,7 @@ impl<R: AsyncRead> AsyncRead for Take<R> {
185185
Poll::Ready(Ok(n))
186186
}
187187

188-
#[cfg(feature = "read_initializer")]
188+
#[cfg(feature = "read-initializer")]
189189
unsafe fn initializer(&self) -> Initializer {
190190
self.inner.initializer()
191191
}

futures-util/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! and the `AsyncRead` and `AsyncWrite` traits.
33
44
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]
5-
#![cfg_attr(feature = "read_initializer", feature(read_initializer))]
5+
#![cfg_attr(feature = "read-initializer", feature(read_initializer))]
66

77
#![cfg_attr(not(feature = "std"), no_std)]
88
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms, unreachable_pub)]
@@ -20,8 +20,8 @@ compile_error!("The `cfg-target-has-atomic` feature requires the `unstable` feat
2020
#[cfg(all(feature = "bilock", not(feature = "unstable")))]
2121
compile_error!("The `bilock` feature requires the `unstable` feature as an explicit opt-in to unstable features");
2222

23-
#[cfg(all(feature = "read_initializer", not(feature = "unstable")))]
24-
compile_error!("The `read_initializer` feature requires the `unstable` feature as an explicit opt-in to unstable features");
23+
#[cfg(all(feature = "read-initializer", not(feature = "unstable")))]
24+
compile_error!("The `read-initializer` feature requires the `unstable` feature as an explicit opt-in to unstable features");
2525

2626
#[cfg(feature = "alloc")]
2727
extern crate alloc;

futures/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ alloc = ["futures-core-preview/alloc", "futures-sink-preview/alloc", "futures-ch
4242
async-await = ["futures-util-preview/async-await", "futures-util-preview/async-await-macro"]
4343
compat = ["std", "futures-util-preview/compat"]
4444
io-compat = ["compat", "futures-util-preview/io-compat"]
45-
threadpool = ["futures-executor-preview/threadpool"]
45+
thread-pool = ["futures-executor-preview/thread-pool"]
4646

4747
# Unstable features
4848
# These features are outside of the normal semver guarantees and require the
4949
# `unstable` feature as an explicit opt-in to unstable API.
5050
unstable = ["futures-core-preview/unstable", "futures-channel-preview/unstable", "futures-io-preview/unstable", "futures-util-preview/unstable"]
5151
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-channel-preview/cfg-target-has-atomic", "futures-util-preview/cfg-target-has-atomic"]
5252
bilock = ["futures-util-preview/bilock"]
53-
read_initializer = ["futures-io-preview/read_initializer", "futures-util-preview/read_initializer"]
53+
read-initializer = ["futures-io-preview/read-initializer", "futures-util-preview/read-initializer"]
5454

5555
[package.metadata.docs.rs]
5656
all-features = true

0 commit comments

Comments
 (0)