From 8cab4c6d4b2fe7c21921731eb803d34788f691fd Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Wed, 29 Dec 2021 09:40:21 +0100 Subject: [PATCH] Update itoa and dirs --- Cargo.lock | 16 +++++++++++----- sqlx-core/Cargo.toml | 4 ++-- sqlx-core/src/mssql/arguments.rs | 2 +- sqlx-core/src/mssql/protocol/type_info.rs | 2 +- sqlx-core/src/postgres/io/buf_mut.rs | 4 ++-- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7037e35fe2..6e88529ced 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -641,7 +641,7 @@ checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" dependencies = [ "bstr", "csv-core", - "itoa", + "itoa 0.4.7", "ryu", "serde", ] @@ -682,9 +682,9 @@ dependencies = [ [[package]] name = "dirs" -version = "3.0.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ "dirs-sys", ] @@ -1156,6 +1156,12 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + [[package]] name = "jobserver" version = "0.1.22" @@ -2222,7 +2228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ "indexmap", - "itoa", + "itoa 0.4.7", "ryu", "serde", ] @@ -2420,7 +2426,7 @@ dependencies = [ "hmac", "indexmap", "ipnetwork", - "itoa", + "itoa 1.0.1", "libc", "libsqlite3-sys", "log", diff --git a/sqlx-core/Cargo.toml b/sqlx-core/Cargo.toml index b024aa3d16..557d3375ee 100644 --- a/sqlx-core/Cargo.toml +++ b/sqlx-core/Cargo.toml @@ -115,7 +115,7 @@ crossbeam-queue = "0.3.1" crossbeam-channel = "0.5.0" crossbeam-utils = { version = "0.8.1", default-features = false } digest = { version = "0.9.0", default-features = false, optional = true, features = ["std"] } -dirs = { version = "3.0.1", optional = true } +dirs = { version = "4", optional = true } encoding_rs = { version = "0.8.23", optional = true } either = "1.5.3" futures-channel = { version = "0.3.5", default-features = false, features = ["sink", "alloc", "std"] } @@ -125,7 +125,7 @@ futures-util = { version = "0.3.5", default-features = false, features = ["alloc generic-array = { version = "0.14.4", default-features = false, optional = true } hex = "0.4.2" hmac = { version = "0.11.0", default-features = false, optional = true } -itoa = "0.4.5" +itoa = "1" ipnetwork = { version = "0.17.0", default-features = false, optional = true } mac_address = { version = "1.1", default-features = false, optional = true } libc = "0.2.71" diff --git a/sqlx-core/src/mssql/arguments.rs b/sqlx-core/src/mssql/arguments.rs index f4ed37e8b4..f6e8827c28 100644 --- a/sqlx-core/src/mssql/arguments.rs +++ b/sqlx-core/src/mssql/arguments.rs @@ -72,7 +72,7 @@ impl MssqlArguments { self.name.push_str("@p"); self.ordinal += 1; - let _ = itoa::fmt(&mut self.name, self.ordinal); + self.name.push_str(itoa::Buffer::new().format(self.ordinal)); let MssqlArguments { ref name, diff --git a/sqlx-core/src/mssql/protocol/type_info.rs b/sqlx-core/src/mssql/protocol/type_info.rs index ef27e49463..99a22438c2 100644 --- a/sqlx-core/src/mssql/protocol/type_info.rs +++ b/sqlx-core/src/mssql/protocol/type_info.rs @@ -567,7 +567,7 @@ impl TypeInfo { // size if self.size < 8000 && self.size > 0 { s.push_str("("); - let _ = itoa::fmt(&mut *s, self.size); + s.push_str(itoa::Buffer::new().format(self.size)); s.push_str(")"); } else { s.push_str("(max)"); diff --git a/sqlx-core/src/postgres/io/buf_mut.rs b/sqlx-core/src/postgres/io/buf_mut.rs index d9366302de..e7159f522e 100644 --- a/sqlx-core/src/postgres/io/buf_mut.rs +++ b/sqlx-core/src/postgres/io/buf_mut.rs @@ -33,7 +33,7 @@ impl PgBufMutExt for Vec { // N.B. if you change this don't forget to update it in ../describe.rs self.extend(b"sqlx_s_"); - itoa::write(&mut *self, id).unwrap(); + self.extend(itoa::Buffer::new().format(id).as_bytes()); self.push(0); } @@ -44,7 +44,7 @@ impl PgBufMutExt for Vec { if let Some(id) = id { self.extend(b"sqlx_p_"); - itoa::write(&mut *self, id).unwrap(); + self.extend(itoa::Buffer::new().format(id).as_bytes()); } self.push(0);