Skip to content

Commit

Permalink
Merge pull request #163 from jlebon/pr/move-away-from-users
Browse files Browse the repository at this point in the history
Move away from deprecated `users` to `uzers`
  • Loading branch information
HuijingHei authored Sep 20, 2023
2 parents b042ccb + 0efb08b commit a90d765
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ path = "src/main.rs"
[dependencies]
anyhow = ">= 1.0.38, < 2"
clap = { version = "4", default-features = false, features = ["std", "cargo", "help", "string", "usage"] }
users = ">= 0.10, < 0.12"
uzers = ">= 0.10, < 0.12"

[dev-dependencies]
nix = ">= 0.17, < 0.27"
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Changes:

- Replace deprecated dependency users by uzers


## ssh-key-dir 0.1.4 (2022-09-27)
Expand Down
2 changes: 1 addition & 1 deletion src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::os::unix::fs::{MetadataExt, PermissionsExt};
use std::path::{Path, PathBuf};

use anyhow::{bail, Context, Result};
use users::get_effective_uid;
use uzers::get_effective_uid;

const KEYS_SUBDIR: &str = "authorized_keys.d";

Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use std::io;

use anyhow::{Context, Result};
use clap::{crate_version, value_parser, Arg, Command};
use users::os::unix::UserExt;
use users::switch::{switch_user_group, SwitchUserGuard};
use users::{get_current_username, get_user_by_name, User};
use uzers::os::unix::UserExt;
use uzers::switch::{switch_user_group, SwitchUserGuard};
use uzers::{get_current_username, get_user_by_name, User};

use crate::keys::read_keys;

Expand Down Expand Up @@ -87,7 +87,7 @@ fn main() -> Result<()> {
mod tests {
use super::*;

use users::{get_current_username, get_effective_uid};
use uzers::{get_current_username, get_effective_uid};

fn wrap_switch_user(username: &str) -> Result<User> {
switch_user(&OsString::from(username)).map(|(u, _g)| u)
Expand Down

0 comments on commit a90d765

Please sign in to comment.