Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use singular number for all feature names #1694

Merged
merged 2 commits into from Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Expand Up @@ -36,19 +36,19 @@ memoffset = { version = "0.6.3", optional = true }

[features]
default = [
"acct", "aio", "dir", "env", "event", "features", "fs",
"acct", "aio", "dir", "env", "event", "feature", "fs",
"hostname", "inotify", "ioctl", "kmod", "mman", "mount", "mqueue",
"net", "personality", "poll", "process", "pthread", "ptrace", "quota",
"reboot", "resource", "sched", "signal", "socket", "term", "time",
"ucontext", "uio", "users", "zerocopy",
"ucontext", "uio", "user", "zerocopy",
]

acct = []
aio = []
dir = ["fs"]
env = []
event = []
features = []
feature = []
fs = []
hostname = []
inotify = []
Expand All @@ -73,7 +73,7 @@ term = []
time = []
ucontext = ["signal"]
uio = []
users = ["features"]
user = ["feature"]
zerocopy = ["fs", "uio"]

[dev-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Expand Up @@ -12,7 +12,7 @@
//! * `dir` - Stuff relating to directory iteration
//! * `env` - Manipulate environment variables
//! * `event` - Event-driven APIs, like `kqueue` and `epoll`
//! * `features` - Query characteristics of the OS at runtime
//! * `feature` - Query characteristics of the OS at runtime
//! * `fs` - File system functionality
//! * `hostname` - Get and set the system's hostname
//! * `inotify` - Linux's `inotify` file system notification API
Expand All @@ -37,7 +37,7 @@
//! * `time` - Query the operating system's clocks
//! * `ucontext` - User thread context
//! * `uio` - Vectored I/O
//! * `users` - Stuff relating to users and groups
//! * `user` - Stuff relating to users and groups
//! * `zerocopy` - APIs like `sendfile` and `copy_file_range`
#![crate_name = "nix"]
#![cfg(unix)]
Expand Down Expand Up @@ -75,7 +75,7 @@ feature! {
#[allow(missing_docs)]
pub mod errno;
feature! {
#![feature = "features"]
#![feature = "feature"]

#[deny(missing_docs)]
pub mod features;
Expand Down
2 changes: 1 addition & 1 deletion src/sys/mod.rs
Expand Up @@ -177,7 +177,7 @@ feature! {
}

feature! {
#![feature = "features"]
#![feature = "feature"]
pub mod utsname;
}

Expand Down
24 changes: 12 additions & 12 deletions src/unistd.rs
Expand Up @@ -45,7 +45,7 @@ pub use self::setres::*;
pub use self::getres::*;

feature! {
#![feature = "users"]
#![feature = "user"]

/// User identifier
///
Expand Down Expand Up @@ -591,7 +591,7 @@ pub fn symlinkat<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(

// Double the buffer capacity up to limit. In case it already has
// reached the limit, return Errno::ERANGE.
#[cfg(any(feature = "fs", feature = "users"))]
#[cfg(any(feature = "fs", feature = "user"))]
fn reserve_double_buffer_size<T>(buf: &mut Vec<T>, limit: usize) -> Result<()> {
use std::cmp::min;

Expand Down Expand Up @@ -654,7 +654,7 @@ pub fn getcwd() -> Result<PathBuf> {
}

feature! {
#![all(feature = "users", feature = "fs")]
#![all(feature = "user", feature = "fs")]

/// Computes the raw UID and GID values to pass to a `*chown` call.
// The cast is not unnecessary on all platforms.
Expand Down Expand Up @@ -1348,7 +1348,7 @@ pub fn fdatasync(fd: RawFd) -> Result<()> {
}

feature! {
#![feature = "users"]
#![feature = "user"]

/// Get a real user ID
///
Expand Down Expand Up @@ -1432,7 +1432,7 @@ pub fn setgid(gid: Gid) -> Result<()> {
}

feature! {
#![all(feature = "fs", feature = "users")]
#![all(feature = "fs", feature = "user")]
/// Set the user identity used for filesystem checks per-thread.
/// On both success and failure, this call returns the previous filesystem user
/// ID of the caller.
Expand All @@ -1457,7 +1457,7 @@ pub fn setfsgid(gid: Gid) -> Gid {
}

feature! {
#![feature = "users"]
#![feature = "user"]

/// Get the list of supplementary group IDs of the calling process.
///
Expand Down Expand Up @@ -1868,7 +1868,7 @@ pub fn mkstemp<P: ?Sized + NixPath>(template: &P) -> Result<(RawFd, PathBuf)> {
}

feature! {
#![all(feature = "fs", feature = "features")]
#![all(feature = "fs", feature = "feature")]

/// Variable names for `pathconf`
///
Expand Down Expand Up @@ -2064,7 +2064,7 @@ pub fn pathconf<P: ?Sized + NixPath>(path: &P, var: PathconfVar) -> Result<Optio
}

feature! {
#![feature = "features"]
#![feature = "feature"]

/// Variable names for `sysconf`
///
Expand Down Expand Up @@ -2705,7 +2705,7 @@ mod pivot_root {
target_os = "openbsd"))]
mod setres {
feature! {
#![feature = "users"]
#![feature = "user"]

use crate::Result;
use crate::errno::Errno;
Expand Down Expand Up @@ -2752,7 +2752,7 @@ mod setres {
target_os = "openbsd"))]
mod getres {
feature! {
#![feature = "users"]
#![feature = "user"]

use crate::Result;
use crate::errno::Errno;
Expand Down Expand Up @@ -2846,7 +2846,7 @@ pub fn access<P: ?Sized + NixPath>(path: &P, amode: AccessFlags) -> Result<()> {
}

feature! {
#![feature = "users"]
#![feature = "user"]

/// Representation of a User, based on `libc::passwd`
///
Expand Down Expand Up @@ -3212,7 +3212,7 @@ pub fn ttyname(fd: RawFd) -> Result<PathBuf> {
}

feature! {
#![all(feature = "socket", feature = "users")]
#![all(feature = "socket", feature = "user")]

/// Get the effective user ID and group ID associated with a Unix domain socket.
///
Expand Down