You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

writeable

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

writeable - cargo Package Compare versions

Comparing version
0.2.0
to
0.2.1
+91
src/impls.rs
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
use crate::LengthHint;
use crate::Writeable;
use core::convert::TryFrom;
use core::fmt;
use core::str;
impl Writeable for u8 {
fn write_to<W: fmt::Write + ?Sized>(&self, sink: &mut W) -> fmt::Result {
let mut buf = [b'0'; 3];
let mut n = *self;
let mut i = 3usize;
while n != 0 {
i -= 1;
buf[i] = b'0' + (n % 10);
n /= 10;
}
if i == 3 {
debug_assert_eq!(*self, 0);
i = 2;
}
let s = unsafe { str::from_utf8_unchecked(&buf[i..]) };
sink.write_str(s)
}
fn write_len(&self) -> LengthHint {
if *self < 10 {
LengthHint::Exact(1)
} else if *self < 100 {
LengthHint::Exact(2)
} else {
LengthHint::Exact(3)
}
}
}
impl Writeable for u16 {
fn write_to<W: fmt::Write + ?Sized>(&self, sink: &mut W) -> fmt::Result {
let mut buf = [b'0'; 5];
let mut n = *self;
let mut i = 5usize;
while n != 0 {
i -= 1;
buf[i] = b'0' + u8::try_from(n % 10).expect("<10");
n /= 10;
}
if i == 5 {
debug_assert_eq!(*self, 0);
i = 4;
}
let s = unsafe { str::from_utf8_unchecked(&buf[i..]) };
sink.write_str(s)
}
fn write_len(&self) -> LengthHint {
if *self < 10 {
LengthHint::Exact(1)
} else if *self < 100 {
LengthHint::Exact(2)
} else if *self < 1000 {
LengthHint::Exact(3)
} else if *self < 10000 {
LengthHint::Exact(4)
} else {
LengthHint::Exact(5)
}
}
}
#[test]
fn test_u8() {
use crate::assert_writeable_eq;
assert_writeable_eq!("0", &0u8);
assert_writeable_eq!("1", &1u8);
assert_writeable_eq!("10", &10u8);
assert_writeable_eq!("99", &99u8);
assert_writeable_eq!("255", &255u8);
}
#[test]
fn test_u16() {
use crate::assert_writeable_eq;
assert_writeable_eq!("0", &0u16);
assert_writeable_eq!("1", &1u16);
assert_writeable_eq!("10", &10u16);
assert_writeable_eq!("99", &99u16);
assert_writeable_eq!("65535", &65535u16);
}
+1
-1
{
"git": {
"sha1": "377ba0e6c90280d1dfa6973fce643c439b021c3b"
"sha1": "6975267434af46fc4ec70fc7c7459a2bc74c2699"
}
}
+91
-117
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]

@@ -22,11 +24,11 @@ name = "atty"

name = "bitflags"
version = "1.2.1"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bstr"
version = "0.2.15"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d"
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [

@@ -41,17 +43,11 @@ "lazy_static",

name = "bumpalo"
version = "3.6.1"
version = "3.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe"
checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c"
[[package]]
name = "byteorder"
version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "cast"
version = "0.2.5"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc38c385bfd7e444464011bb24820f40dd1c76bcdfa1b78611cb7c2e5cafab75"
checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a"
dependencies = [

@@ -80,5 +76,5 @@ "rustc_version",

name = "criterion"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23"
checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10"
dependencies = [

@@ -90,3 +86,3 @@ "atty",

"csv",
"itertools 0.10.0",
"itertools",
"lazy_static",

@@ -108,8 +104,8 @@ "num-traits",

name = "criterion-plot"
version = "0.4.3"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d"
checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57"
dependencies = [
"cast",
"itertools 0.9.0",
"itertools",
]

@@ -129,5 +125,5 @@

name = "crossbeam-deque"
version = "0.8.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
dependencies = [

@@ -141,5 +137,5 @@ "cfg-if",

name = "crossbeam-epoch"
version = "0.9.3"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12"
checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
dependencies = [

@@ -155,7 +151,6 @@ "cfg-if",

name = "crossbeam-utils"
version = "0.8.3"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49"
checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"
dependencies = [
"autocfg",
"cfg-if",

@@ -195,11 +190,11 @@ "lazy_static",

name = "half"
version = "1.7.1"
version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3"
checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
[[package]]
name = "hermit-abi"
version = "0.1.18"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [

@@ -211,11 +206,11 @@ "libc",

name = "icu_benchmark_macros"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53af96177ef51245c6a7a4eb7be5f30631b5c536779e5eec63ce6e41cf0edcf6"
checksum = "f8b52b58b602655250d6d5f407835bcfe9b9e1a1d22bbc59b11f0c8056a55b0f"
[[package]]
name = "itertools"
version = "0.9.0"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
dependencies = [

@@ -226,21 +221,12 @@ "either",

[[package]]
name = "itertools"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319"
dependencies = [
"either",
]
[[package]]
name = "itoa"
version = "0.4.7"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "js-sys"
version = "0.3.50"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c"
checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
dependencies = [

@@ -258,5 +244,5 @@ "wasm-bindgen",

name = "libc"
version = "0.2.94"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673"

@@ -274,11 +260,11 @@ [[package]]

name = "memchr"
version = "2.3.4"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memoffset"
version = "0.6.3"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d"
checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
dependencies = [

@@ -315,5 +301,5 @@ "autocfg",

name = "plotters"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45ca0ae5f169d0917a7c7f5a9c1a3d3d9598f18f529dd2b8373ed988efea307a"
checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a"
dependencies = [

@@ -329,11 +315,11 @@ "num-traits",

name = "plotters-backend"
version = "0.3.0"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b07fffcddc1cb3a1de753caa4e4df03b79922ba43cf882acc1bdd7e8df9f4590"
checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c"
[[package]]
name = "plotters-svg"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b38a02e23bd9604b842a812063aec4ef702b57989c37b655254bb61c471ad211"
checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9"
dependencies = [

@@ -345,5 +331,5 @@ "plotters-backend",

name = "proc-macro2"
version = "1.0.26"
version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"
checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"
dependencies = [

@@ -355,5 +341,5 @@ "unicode-xid",

name = "quote"
version = "1.0.9"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
dependencies = [

@@ -365,5 +351,5 @@ "proc-macro2",

name = "rayon"
version = "1.5.0"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
dependencies = [

@@ -378,5 +364,5 @@ "autocfg",

name = "rayon-core"
version = "1.9.0"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a"
checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
dependencies = [

@@ -392,5 +378,5 @@ "crossbeam-channel",

name = "regex"
version = "1.4.6"
version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759"
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
dependencies = [

@@ -402,20 +388,17 @@ "regex-syntax",

name = "regex-automata"
version = "0.1.9"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4"
dependencies = [
"byteorder",
]
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
[[package]]
name = "regex-syntax"
version = "0.6.23"
version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548"
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "rustc_version"
version = "0.2.3"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [

@@ -448,26 +431,17 @@ "semver",

name = "semver"
version = "0.9.0"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [
"semver-parser",
]
checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "serde"
version = "1.0.125"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
[[package]]
name = "serde_cbor"
version = "0.11.1"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622"
checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5"
dependencies = [

@@ -480,5 +454,5 @@ "half",

name = "serde_derive"
version = "1.0.125"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
dependencies = [

@@ -492,5 +466,5 @@ "proc-macro2",

name = "serde_json"
version = "1.0.64"
version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
dependencies = [

@@ -504,5 +478,5 @@ "itoa",

name = "syn"
version = "1.0.71"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad184cc9470f9117b2ac6817bfe297307418819ba40552f9b3846f05c33d5373"
checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966"
dependencies = [

@@ -535,11 +509,11 @@ "proc-macro2",

name = "unicode-width"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "unicode-xid"
version = "0.2.1"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"

@@ -559,5 +533,5 @@ [[package]]

name = "wasm-bindgen"
version = "0.2.73"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9"
checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
dependencies = [

@@ -570,5 +544,5 @@ "cfg-if",

name = "wasm-bindgen-backend"
version = "0.2.73"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae"
checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
dependencies = [

@@ -586,5 +560,5 @@ "bumpalo",

name = "wasm-bindgen-macro"
version = "0.2.73"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f"
checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
dependencies = [

@@ -597,5 +571,5 @@ "quote",

name = "wasm-bindgen-macro-support"
version = "0.2.73"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c"
checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
dependencies = [

@@ -611,11 +585,11 @@ "proc-macro2",

name = "wasm-bindgen-shared"
version = "0.2.73"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489"
checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
[[package]]
name = "web-sys"
version = "0.3.50"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be"
checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb"
dependencies = [

@@ -659,3 +633,3 @@ "js-sys",

name = "writeable"
version = "0.2.0"
version = "0.2.1"
dependencies = [

@@ -662,0 +636,0 @@ "criterion",

@@ -6,8 +6,7 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

@@ -17,5 +16,5 @@ [package]

name = "writeable"
version = "0.2.0"
version = "0.2.1"
authors = ["The ICU4X Project Developers"]
include = ["src/**/*", "examples/**/*", "benches/**/*", "tests/**/*", "Cargo.toml", "README.md"]
include = ["src/**/*", "examples/**/*", "benches/**/*", "tests/**/*", "Cargo.toml", "LICENSE", "README.md"]
description = "A more efficient alternative to fmt::Display"

@@ -25,2 +24,5 @@ readme = "README.md"

repository = "https://github.com/unicode-org/icu4x"
resolver = "2"
[package.metadata.docs.rs]
all-features = true

@@ -38,3 +40,3 @@ [lib]

[dev-dependencies.icu_benchmark_macros]
version = "0.2"
version = "0.3"

@@ -41,0 +43,0 @@ [features]

@@ -1,2 +0,2 @@

# writeable [![crates.io](http://meritbadge.herokuapp.com/writeable)](https://crates.io/crates/writeable)
# writeable [![crates.io](https://img.shields.io/crates/v/writeable)](https://crates.io/crates/writeable)

@@ -3,0 +3,0 @@ `writeable` is a utility crate of the [`ICU4X`] project.

@@ -5,2 +5,4 @@ // This file is part of ICU4X. For terms of use, please see the file

#![cfg_attr(not(test), no_std)]
//! `writeable` is a utility crate of the [`ICU4X`] project.

@@ -53,5 +55,9 @@ //!

extern crate alloc;
mod impls;
mod ops;
use std::fmt;
use alloc::string::String;
use core::fmt;

@@ -58,0 +64,0 @@ /// A hint to help consumers of Writeable pre-allocate bytes before they call write_to.

@@ -7,3 +7,3 @@ // This file is part of ICU4X. For terms of use, please see the file

impl std::ops::Add<LengthHint> for LengthHint {
impl core::ops::Add<LengthHint> for LengthHint {
type Output = Self;

@@ -22,3 +22,3 @@

impl std::ops::AddAssign<LengthHint> for LengthHint {
impl core::ops::AddAssign<LengthHint> for LengthHint {
fn add_assign(&mut self, other: Self) {

@@ -29,3 +29,3 @@ *self = *self + other;

impl std::iter::Sum<LengthHint> for LengthHint {
impl core::iter::Sum<LengthHint> for LengthHint {
fn sum<I>(iter: I) -> Self

@@ -35,7 +35,7 @@ where

{
iter.fold(LengthHint::Exact(0), std::ops::Add::add)
iter.fold(LengthHint::Exact(0), core::ops::Add::add)
}
}
impl std::ops::Add<usize> for LengthHint {
impl core::ops::Add<usize> for LengthHint {
type Output = Self;

@@ -51,3 +51,3 @@

impl std::ops::AddAssign<usize> for LengthHint {
impl core::ops::AddAssign<usize> for LengthHint {
fn add_assign(&mut self, other: usize) {

@@ -58,3 +58,3 @@ *self = *self + other;

impl std::iter::Sum<usize> for LengthHint {
impl core::iter::Sum<usize> for LengthHint {
fn sum<I>(iter: I) -> Self

@@ -61,0 +61,0 @@ where

Sorry, the diff of this file is not supported yet