Skip to content
Snippets Groups Projects
Commit d39ac3468ad4 authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

rust-dependencies: switch from `users` to `whoami`

`users` is unmaintained, with the maintainer apparently MIA. `whoami` is a
popular crate that does simple wrapping of platform-specific calls.

This makes the overhead from using `blackbox` lower. It used to be up 10ms
on slower hardware for both calls, now down to <1ms which is always good.
parent 2cc5de261d76
No related branches found
No related tags found
2 merge requests!618Draft: 6.5rc0,!606Switch from unmaintained Rust dependencies
......@@ -1060,5 +1060,4 @@
"logging_timer",
"rayon",
"regex",
"users",
"which",
......@@ -1064,4 +1063,5 @@
"which",
"whoami",
]
[[package]]
......@@ -1242,16 +1242,6 @@
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
[[package]]
name = "users"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032"
dependencies = [
"libc",
"log",
]
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
......@@ -1347,6 +1337,16 @@
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
[[package]]
name = "web-sys"
version = "0.3.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]]
name = "which"
version = "4.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
......@@ -1358,6 +1358,16 @@
]
[[package]]
name = "whoami"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c70234412ca409cc04e864e89523cb0fc37f5e1344ebed5a3ebf4192b6b9f68"
dependencies = [
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
......
......@@ -20,6 +20,6 @@
regex = "1.7.0"
env_logger = "0.9.3"
format-bytes = "0.3.0"
users = "0.11.0"
whoami = "1.4"
which = "4.3.0"
rayon = "1.7.0"
......@@ -120,8 +120,7 @@
impl ConfiguredBlackbox<'_> {
fn log(&self, date_time: &DateTime, message: &[u8]) {
let date = format_bytes::Utf8(date_time.format(self.date_format));
let user = users::get_current_username().map(get_bytes_from_os_str);
let user = user.as_deref().unwrap_or(b"???");
let user = get_bytes_from_os_str(whoami::username_os());
let rev = format_bytes::Utf8(match self.repo.dirstate_parents() {
Ok(parents) if parents.p2 == hg::revlog::node::NULL_NODE => {
format!("{:x}", parents.p1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment