From 181ac3b8714d3a45e8c7b8c0e09b0a80954d7cf0 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Wed, 20 Nov 2024 08:11:04 -0500 Subject: [PATCH] Use new itoa --- Cargo.toml | 2 +- src/path/dec_int.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fbda86c5e..d83d3d9d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ rust-version = "1.63" [dependencies] bitflags = { version = "2.4.0", default-features = false } -itoa = { version = "1.0.1", default-features = false, optional = true } +itoa = { version = "1.0.12", default-features = false, optional = true } # Special dependencies used in rustc-dep-of-std mode. core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" } diff --git a/src/path/dec_int.rs b/src/path/dec_int.rs index 0ca5af377..52c54f46b 100644 --- a/src/path/dec_int.rs +++ b/src/path/dec_int.rs @@ -37,9 +37,10 @@ use {core::fmt, std::ffi::OsStr, std::path::Path}; #[derive(Clone)] pub struct DecInt { // Enough to hold an {u,i}64 and NUL terminator. - buf: [MaybeUninit; "-9223372036854775808\0".len()], + buf: [MaybeUninit; u64::MAX_STR_LEN + 1], len: usize, } +const _: () = assert!(u64::MAX_STR_LEN == i64::MAX_STR_LEN); impl DecInt { /// Construct a new path component from an integer.