| { | ||
| "git": { | ||
| "sha1": "a90f36f0de8c984662c49fb5742027ca24a88cbb" | ||
| "sha1": "c857a1c2b92353217adf83199845f8d6eb8ca0f6" | ||
| }, | ||
| "path_in_vcs": "" | ||
| } |
+20
-29
@@ -7,3 +7,3 @@ # This file is automatically @generated by Cargo. | ||
| name = "bstr" | ||
| version = "1.12.1" | ||
| version = "1.12.2" | ||
| dependencies = [ | ||
@@ -13,3 +13,3 @@ "memchr", | ||
| "regex-automata", | ||
| "serde", | ||
| "serde_core", | ||
| "ucd-parse", | ||
@@ -27,5 +27,5 @@ "unicode-segmentation", | ||
| name = "getrandom" | ||
| version = "0.2.16" | ||
| version = "0.2.17" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" | ||
| checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" | ||
| dependencies = [ | ||
@@ -39,17 +39,17 @@ "cfg-if", | ||
| name = "libc" | ||
| version = "0.2.177" | ||
| version = "0.2.181" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" | ||
| checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5" | ||
| [[package]] | ||
| name = "memchr" | ||
| version = "2.7.6" | ||
| version = "2.8.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" | ||
| checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" | ||
| [[package]] | ||
| name = "proc-macro2" | ||
| version = "1.0.103" | ||
| version = "1.0.106" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" | ||
| checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" | ||
| dependencies = [ | ||
@@ -70,5 +70,5 @@ "unicode-ident", | ||
| name = "quote" | ||
| version = "1.0.41" | ||
| version = "1.0.44" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" | ||
| checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" | ||
| dependencies = [ | ||
@@ -98,22 +98,13 @@ "proc-macro2", | ||
| name = "regex-automata" | ||
| version = "0.4.13" | ||
| version = "0.4.14" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" | ||
| checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" | ||
| [[package]] | ||
| name = "regex-lite" | ||
| version = "0.1.8" | ||
| version = "0.1.9" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "8d942b98df5e658f56f20d592c7f868833fe38115e65c33003d8cd224b0155da" | ||
| checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" | ||
| [[package]] | ||
| name = "serde" | ||
| version = "1.0.228" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" | ||
| dependencies = [ | ||
| "serde_core", | ||
| ] | ||
| [[package]] | ||
| name = "serde_core" | ||
@@ -140,5 +131,5 @@ version = "1.0.228" | ||
| name = "syn" | ||
| version = "2.0.108" | ||
| version = "2.0.114" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" | ||
| checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" | ||
| dependencies = [ | ||
@@ -161,5 +152,5 @@ "proc-macro2", | ||
| name = "unicode-ident" | ||
| version = "1.0.20" | ||
| version = "1.0.23" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" | ||
| checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e" | ||
@@ -166,0 +157,0 @@ [[package]] |
+5
-5
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "bstr" | ||
| version = "1.12.1" | ||
| version = "1.12.2" | ||
| authors = ["Andrew Gallant <jamslam@gmail.com>"] | ||
@@ -59,3 +59,3 @@ build = false | ||
| "memchr/alloc", | ||
| "serde?/alloc", | ||
| "serde_core?/alloc", | ||
| ] | ||
@@ -66,7 +66,7 @@ default = [ | ||
| ] | ||
| serde = ["dep:serde"] | ||
| serde = ["dep:serde_core"] | ||
| std = [ | ||
| "alloc", | ||
| "memchr/std", | ||
| "serde?/std", | ||
| "serde_core?/std", | ||
| ] | ||
@@ -135,3 +135,3 @@ unicode = ["dep:regex-automata"] | ||
| [dependencies.serde] | ||
| [dependencies.serde_core] | ||
| version = "1.0.85" | ||
@@ -138,0 +138,0 @@ optional = true |
+2
-2
@@ -928,3 +928,3 @@ macro_rules! impl_partial_eq { | ||
| use serde::{ | ||
| use serde_core::{ | ||
| de::Error, de::Visitor, Deserialize, Deserializer, Serialize, | ||
@@ -989,3 +989,3 @@ Serializer, | ||
| use serde::{ | ||
| use serde_core::{ | ||
| de::Error, de::SeqAccess, de::Visitor, Deserialize, Deserializer, | ||
@@ -992,0 +992,0 @@ Serialize, Serializer, |
+36
-3
@@ -123,2 +123,26 @@ use core::{char, cmp, fmt, str}; | ||
| } | ||
| #[inline] | ||
| fn count(mut self) -> usize { | ||
| let mut count = 0; | ||
| loop { | ||
| // ASCII fast path taken if two consecutive ASCII chars found | ||
| match self.bs { | ||
| [fst, snd, ..] if *fst <= 0x7F && *snd <= 0x7F => { | ||
| let size = ascii::first_non_ascii_byte(self.bs); | ||
| count += size; | ||
| self.bs = &self.bs[size..]; | ||
| } | ||
| _ => (), | ||
| } | ||
| let (_ch, size) = decode(self.bs); | ||
| if size == 0 { | ||
| return count; | ||
| } else { | ||
| count += 1; | ||
| self.bs = &self.bs[size..]; | ||
| } | ||
| } | ||
| } | ||
| } | ||
@@ -568,5 +592,6 @@ | ||
| /// When unsuccessful, `None` is returned along with the number of bytes that | ||
| /// make up a maximal prefix of a valid UTF-8 code unit sequence. In this case, | ||
| /// the number of bytes consumed is always between 0 and 3, inclusive, where | ||
| /// 0 is only returned when `slice` is empty. | ||
| /// make up a maximal prefix of a valid UTF-8 code unit sequence. When there is | ||
| /// no prefix of a valid UTF-8 code unit sequence, then 1 byte is consumed. | ||
| /// Thus, for a non-empty slice given, the number of bytes consumed is always | ||
| /// at least `1`. `0` is only returned when `slice` is empty. | ||
| /// | ||
@@ -1249,2 +1274,10 @@ /// # Examples | ||
| for (i, &(expected, input)) in LOSSY_TESTS.iter().enumerate() { | ||
| assert_eq!( | ||
| B(input).chars().collect::<Vec<char>>().len(), | ||
| B(input).chars().count(), | ||
| "chars.count(ith: {:?}, given: {:?})", | ||
| i, | ||
| input | ||
| ); | ||
| let got: String = B(input).chars().collect(); | ||
@@ -1251,0 +1284,0 @@ assert_eq!( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display