Skip to content

Commit 628b217

Browse files
committed
Optimize core::str::Chars::count
1 parent 71226d7 commit 628b217

File tree

7 files changed

+346
-29
lines changed

7 files changed

+346
-29
lines changed

library/alloc/tests/str.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,3 +2230,43 @@ fn utf8_chars() {
22302230
assert!((!from_utf8(&[0xf0, 0xff, 0x10]).is_ok()));
22312231
assert!((!from_utf8(&[0xf0, 0xff, 0xff, 0x10]).is_ok()));
22322232
}
2233+
2234+
#[test]
2235+
fn utf8_char_counts() {
2236+
let strs = [("e", 1), ("é", 1), ("€", 1), ("\u{10000}", 1), ("eé€\u{10000}", 4)];
2237+
let mut reps = vec![1, 8, 64, 256, 512, 1024];
2238+
if cfg!(not(miri)) {
2239+
reps.push(1 << 16);
2240+
}
2241+
let counts = if cfg!(miri) { 0..1 } else { 0..8 };
2242+
let padding = counts.map(|len| " ".repeat(len)).collect::<Vec<String>>();
2243+
2244+
for repeat in reps {
2245+
for (tmpl_str, tmpl_char_count) in strs {
2246+
for pad_start in &padding {
2247+
for pad_end in &padding {
2248+
// Create a string with padding...
2249+
let with_padding =
2250+
format!("{}{}{}", pad_start, tmpl_str.repeat(repeat), pad_end);
2251+
// ...and then skip past that padding. This should ensure
2252+
// that we test several different alignments for both head
2253+
// and tail.
2254+
let si = pad_start.len();
2255+
let ei = with_padding.len() - pad_end.len();
2256+
let target = &with_padding[si..ei];
2257+
2258+
assert!(!target.starts_with(" ") && !target.ends_with(" "));
2259+
let expected_count = tmpl_char_count * repeat;
2260+
assert_eq!(
2261+
expected_count,
2262+
target.chars().count(),
2263+
"wrong count for `{:?}.repeat({})` (padding: `{:?}`)",
2264+
tmpl_str,
2265+
repeat,
2266+
(pad_start.len(), pad_end.len()),
2267+
);
2268+
}
2269+
}
2270+
}
2271+
}
2272+
}

library/core/benches/str.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
11
use std::str;
22
use test::{black_box, Bencher};
33

4-
const LOREM_SHORT: &str = "Lorem ipsum";
5-
6-
const LOREM: &str = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
7-
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
8-
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
9-
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
10-
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.
11-
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur";
12-
13-
const EMOJI: &str = "😀😃😄😁😆😅🤣😂🙂🙃😉😊😇🥰😍🤩😘😗☺😚😙🥲😋😛😜🤪😝🤑🤗🤭🤫🤔🤐🤨😐😑😶😶‍🌫️😏😒🙄😬😮‍💨🤥😌😔😪🤤😴😷🤒🤕🤢🤮🤧🥵🥶🥴😵😵‍💫🤯🤠🥳🥸😎🤓🧐😕😟🙁☹😮😯😲😳🥺😦😧😨😰😥😢😭😱😖😣😞😓😩😫🥱😤😡😠🤬😈👿💀☠💩🤡👹👺👻👽👾🤖😺😸😹😻😼😽🙀😿😾🙈🙉🙊💋💌💘💝💖💗💓💞💕💟❣💔❤️‍🔥❤️‍🩹❤🧡💛💚💙💜🤎🖤🤍💯💢💥💫💦💨🕳💣💬👁️‍🗨️🗨🗯💭💤👋🤚🖐✋🖖👌🤌🤏✌🤞🤟🤘🤙👈👉👆🖕👇☝👍👎✊👊🤛🤜👏🙌👐🤲🤝🙏✍💅🤳💪🦾🦿🦵🦶👂🦻👃🧠🫀🫁🦷🦴👀👁👅👄👶🧒👦👧🧑👱👨🧔🧔‍♂️🧔‍♀️👨‍🦰👨‍🦱👨‍🦳👨‍🦲👩👩‍🦰🧑‍🦰👩‍🦱🧑‍🦱👩‍🦳🧑‍🦳👩‍🦲🧑‍🦲👱‍♀️👱‍♂️🧓👴👵🙍🙍‍♂️🙍‍♀️🙎🙎‍♂️🙎‍♀️🙅🙅‍♂️🙅‍♀️🙆🙆‍♂️🙆‍♀️💁💁‍♂️💁‍♀️🙋🙋‍♂️🙋‍♀️🧏🧏‍♂️🧏‍♀️🙇🙇‍♂️🙇‍♀️🤦🤦‍♂️🤦‍♀️🤷🤷‍♂️🤷‍♀️🧑‍⚕️👨‍⚕️👩‍⚕️🧑‍🎓👨‍🎓👩‍🎓🧑‍🏫👨‍🏫👩‍🏫🧑‍⚖️👨‍⚖️👩‍⚖️🧑‍🌾👨‍🌾👩‍🌾🧑‍🍳👨‍🍳👩‍🍳🧑‍🔧👨‍🔧👩‍🔧🧑‍🏭👨‍🏭👩‍🏭🧑‍💼👨‍💼👩‍💼🧑‍🔬👨‍🔬👩‍🔬🧑‍💻👨‍💻👩‍💻🧑‍🎤👨‍🎤👩‍🎤🧑‍🎨👨‍🎨👩‍🎨🧑‍✈️👨‍✈️👩‍✈️🧑‍🚀👨‍🚀👩‍🚀🧑‍🚒👨‍🚒👩‍🚒👮👮‍♂️👮‍♀️🕵🕵️‍♂️🕵️‍♀️💂💂‍♂️💂‍♀️🥷👷👷‍♂️👷‍♀️🤴👸👳👳‍♂️👳‍♀️👲🧕🤵🤵‍♂️🤵‍♀️👰👰‍♂️👰‍♀️🤰🤱👩‍🍼👨‍🍼🧑‍🍼👼🎅🤶🧑‍🎄🦸🦸‍♂️🦸‍♀️🦹🦹‍♂️🦹‍♀️🧙🧙‍♂️🧙‍♀️🧚🧚‍♂️🧚‍♀️🧛🧛‍♂️🧛‍♀️🧜🧜‍♂️🧜‍♀️🧝🧝‍♂️🧝‍♀️🧞🧞‍♂️🧞‍♀️🧟🧟‍♂️🧟‍♀️💆💆‍♂️💆‍♀️💇💇‍♂️💇‍♀️🚶🚶‍♂️🚶‍♀️🧍🧍‍♂️🧍‍♀️🧎🧎‍♂️🧎‍♀️🧑‍🦯👨‍🦯👩‍🦯🧑‍🦼👨‍🦼👩‍🦼🧑‍🦽👨‍🦽👩‍🦽🏃🏃‍♂️🏃‍♀️💃🕺🕴👯👯‍♂️👯‍♀️🧖🧖‍♂️🧖‍♀️🧗🧗‍♂️🧗‍♀️🤺🏇⛷🏂🏌🏌️‍♂️🏌️‍♀️🏄🏄‍♂️🏄‍♀️🚣🚣‍♂️🚣‍♀️🏊🏊‍♂️🏊‍♀️⛹⛹️‍♂️⛹️‍♀️🏋🏋️‍♂️🏋️‍♀️🚴🚴‍♂️🚴‍♀️🚵🚵‍♂️🚵‍♀️🤸🤸‍♂️🤸‍♀️🤼🤼‍♂️🤼‍♀️🤽🤽‍♂️🤽‍♀️🤾🤾‍♂️🤾‍♀️🤹🤹‍♂️🤹‍♀️🧘🧘‍♂️🧘‍♀️🛀🛌🧑‍🤝‍🧑👭👫👬💏👩‍❤️‍💋‍👨👨‍❤️‍💋‍👨👩‍❤️‍💋‍👩💑👩‍❤️‍👨👨‍❤️‍👨👩‍❤️‍👩👪👨‍👩‍👦👨‍👩‍👧👨‍👩‍👧‍👦👨‍👩‍👦‍👦👨‍👩‍👧‍👧👨‍👨‍👦👨‍👨‍👧👨‍👨‍👧‍👦👨‍👨‍👦‍👦👨‍👨‍👧‍👧👩‍👩‍👦👩‍👩‍👧👩‍👩‍👧‍👦👩‍👩‍👦‍👦👩‍👩‍👧‍👧👨‍👦👨‍👦‍👦👨‍👧👨‍👧‍👦👨‍👧‍👧👩‍👦👩‍👦‍👦👩‍👧👩‍👧‍👦👩‍👧‍👧🗣👤👥🫂👣🦰🦱🦳🦲🐵🐒🦍🦧🐶🐕🦮🐕‍🦺🐩🐺🦊🦝🐱🐈🐈‍⬛🦁🐯🐅🐆🐴🐎🦄🦓🦌🦬🐮🐂🐃🐄🐷🐖🐗🐽🐏🐑🐐🐪🐫🦙🦒🐘🦣🦏🦛🐭🐁🐀🐹🐰🐇🐿🦫🦔🦇🐻🐻‍❄️🐨🐼🦥🦦🦨🦘🦡🐾🦃🐔🐓🐣🐤🐥🐦🐧🕊🦅🦆🦢🦉🦤🪶🦩🦚🦜🐸🐊🐢🦎🐍🐲🐉🦕🦖🐳🐋🐬🦭🐟🐠🐡🦈🐙🐚🐌🦋🐛🐜🐝🪲🐞🦗🪳🕷🕸🦂🦟🪰🪱🦠💐🌸💮🏵🌹🥀🌺🌻🌼🌷🌱🪴🌲🌳🌴🌵🌾🌿☘🍀🍁🍂🍃🍇🍈🍉🍊🍋🍌🍍🥭🍎🍏🍐🍑🍒🍓🫐🥝🍅🫒🥥🥑🍆🥔🥕🌽🌶🫑🥒🥬🥦🧄🧅🍄🥜🌰🍞🥐🥖🫓🥨🥯🥞🧇🧀🍖🍗🥩🥓🍔🍟🍕🌭🥪🌮🌯🫔🥙🧆🥚🍳🥘🍲🫕🥣🥗🍿🧈🧂🥫🍱🍘🍙🍚🍛🍜🍝🍠🍢🍣🍤🍥🥮🍡🥟🥠🥡🦀🦞🦐🦑🦪🍦🍧🍨🍩🍪🎂🍰🧁🥧🍫🍬🍭🍮🍯🍼🥛☕🫖🍵🍶🍾🍷🍸🍹🍺🍻🥂🥃🥤🧋🧃🧉🧊🥢🍽🍴🥄🔪🏺🌍🌎🌏🌐🗺🗾🧭🏔⛰🌋🗻🏕🏖🏜🏝🏞🏟🏛🏗🧱🪨🪵🛖🏘🏚🏠🏡🏢🏣🏤🏥🏦🏨🏩🏪🏫🏬🏭🏯🏰💒🗼🗽⛪🕌🛕🕍⛩🕋⛲⛺🌁🌃🏙🌄🌅🌆🌇🌉♨🎠🎡🎢💈🎪🚂🚃🚄🚅🚆🚇🚈🚉🚊🚝🚞🚋🚌🚍🚎🚐🚑🚒🚓🚔🚕🚖🚗🚘🚙🛻🚚🚛🚜🏎🏍🛵🦽🦼🛺🚲🛴🛹🛼🚏🛣🛤🛢⛽🚨🚥🚦🛑🚧⚓⛵🛶🚤🛳⛴🛥🚢✈🛩🛫🛬🪂💺🚁🚟🚠🚡🛰🚀🛸🛎🧳⌛⏳⌚⏰⏱⏲🕰🕛🕧🕐🕜🕑🕝🕒🕞🕓🕟🕔🕠🕕🕡🕖🕢🕗🕣🕘🕤🕙🕥🕚🕦🌑🌒🌓🌔🌕🌖🌗🌘🌙🌚🌛🌜🌡☀🌝🌞🪐⭐🌟🌠🌌☁⛅⛈🌤🌥🌦🌧🌨🌩🌪🌫🌬🌀🌈🌂☂☔⛱⚡❄☃⛄☄🔥💧🌊🎃🎄🎆🎇🧨✨🎈🎉🎊🎋🎍🎎🎏🎐🎑🧧🎀🎁🎗🎟🎫🎖🏆🏅🥇🥈🥉⚽⚾🥎🏀🏐🏈🏉🎾🥏🎳🏏🏑🏒🥍🏓🏸🥊🥋🥅⛳⛸🎣🤿🎽🎿🛷🥌🎯🪀🪁🎱🔮🪄🧿🎮🕹🎰🎲🧩🧸🪅🪆♠♥♦♣♟🃏🀄🎴🎭🖼🎨🧵🪡🧶🪢👓🕶🥽🥼🦺👔👕👖🧣🧤🧥🧦👗👘🥻🩱🩲🩳👙👚👛👜👝🛍🎒🩴👞👟🥾🥿👠👡🩰👢👑👒🎩🎓🧢🪖⛑📿💄💍💎🔇🔈🔉🔊📢📣📯🔔🔕🎼🎵🎶🎙🎚🎛🎤🎧📻🎷🪗🎸🎹🎺🎻🪕🥁";
14-
15-
#[bench]
16-
fn str_char_count_lorem(b: &mut Bencher) {
17-
b.iter(|| black_box(LOREM).chars().count());
18-
}
19-
20-
#[bench]
21-
fn str_char_count_lorem_short(b: &mut Bencher) {
22-
b.iter(|| black_box(LOREM_SHORT).chars().count());
23-
}
24-
25-
#[bench]
26-
fn str_char_count_emoji(b: &mut Bencher) {
27-
b.iter(|| black_box(EMOJI).chars().count());
28-
}
4+
mod char_count;
5+
mod corpora;
296

307
#[bench]
318
fn str_validate_emoji(b: &mut Bencher) {
32-
b.iter(|| str::from_utf8(black_box(EMOJI.as_bytes())));
9+
b.iter(|| str::from_utf8(black_box(corpora::emoji::LARGE.as_bytes())));
3310
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
use super::corpora::*;
2+
use test::{black_box, Bencher};
3+
4+
macro_rules! define_benches {
5+
($( fn $name: ident($arg: ident: &str) $body: block )+) => {
6+
define_benches!(mod en_small, en::SMALL, $($name $arg $body)+);
7+
define_benches!(mod en_medium, en::MEDIUM, $($name $arg $body)+);
8+
define_benches!(mod en_large, en::LARGE, $($name $arg $body)+);
9+
define_benches!(mod en_huge, en::HUGE, $($name $arg $body)+);
10+
11+
define_benches!(mod zh_small, zh::SMALL, $($name $arg $body)+);
12+
define_benches!(mod zh_medium, zh::MEDIUM, $($name $arg $body)+);
13+
define_benches!(mod zh_large, zh::LARGE, $($name $arg $body)+);
14+
define_benches!(mod zh_huge, zh::HUGE, $($name $arg $body)+);
15+
16+
define_benches!(mod ru_small, ru::SMALL, $($name $arg $body)+);
17+
define_benches!(mod ru_medium, ru::MEDIUM, $($name $arg $body)+);
18+
define_benches!(mod ru_large, ru::LARGE, $($name $arg $body)+);
19+
define_benches!(mod ru_huge, ru::HUGE, $($name $arg $body)+);
20+
21+
define_benches!(mod emoji_small, emoji::SMALL, $($name $arg $body)+);
22+
define_benches!(mod emoji_medium, emoji::MEDIUM, $($name $arg $body)+);
23+
define_benches!(mod emoji_large, emoji::LARGE, $($name $arg $body)+);
24+
define_benches!(mod emoji_huge, emoji::HUGE, $($name $arg $body)+);
25+
};
26+
(mod $mod_name: ident, $input: expr, $($name: ident $arg: ident $body: block)+) => {
27+
mod $mod_name {
28+
use super::*;
29+
$(
30+
#[bench]
31+
fn $name(bencher: &mut Bencher) {
32+
let input = $input;
33+
bencher.bytes = input.len() as u64;
34+
let mut input_s = input.to_string();
35+
bencher.iter(|| {
36+
let $arg: &str = &black_box(&mut input_s);
37+
black_box($body)
38+
})
39+
}
40+
)+
41+
}
42+
};
43+
}
44+
45+
define_benches! {
46+
fn case00_cur_libcore(s: &str) {
47+
cur_libcore(s)
48+
}
49+
50+
fn case01_old_libcore(s: &str) {
51+
old_libcore(s)
52+
}
53+
54+
fn case02_iter_increment(s: &str) {
55+
iterator_increment(s)
56+
}
57+
58+
fn case03_manual_char_len(s: &str) {
59+
manual_char_len(s)
60+
}
61+
}
62+
63+
fn cur_libcore(s: &str) -> usize {
64+
s.chars().count()
65+
}
66+
#[inline]
67+
fn utf8_is_cont_byte(byte: u8) -> bool {
68+
(byte as i8) < -64
69+
}
70+
fn old_libcore(s: &str) -> usize {
71+
s.as_bytes().iter().filter(|&&byte| !utf8_is_cont_byte(byte)).count()
72+
}
73+
74+
fn iterator_increment(s: &str) -> usize {
75+
let mut c = 0;
76+
for _ in s.chars() {
77+
c += 1;
78+
}
79+
c
80+
}
81+
82+
fn manual_char_len(s: &str) -> usize {
83+
let s = s.as_bytes();
84+
let mut c = 0;
85+
let mut i = 0;
86+
let l = s.len();
87+
while i < l {
88+
let b = s[i];
89+
if b < 0x80 {
90+
i += 1;
91+
} else if b < 0xe0 {
92+
i += 2;
93+
} else if b < 0xf0 {
94+
i += 3;
95+
} else {
96+
i += 4;
97+
}
98+
c += 1;
99+
}
100+
c
101+
}

library/core/benches/str/corpora.rs

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//! Exposes a number of modules with different kinds of strings.
2+
//!
3+
//! Each module contains `&str` constants named `SMALL`, `MEDIUM`, `LARGE`, and
4+
//! `HUGE`.
5+
//!
6+
//! - The `SMALL` string is generally around 30-40 bytes.
7+
//! - The `MEDIUM` string is generally around 600-700 bytes.
8+
//! - The `LARGE` string is the `MEDIUM` string repeated 8x, and is around 5kb.
9+
//! - The `HUGE` string is the `LARGE` string repeated 8x (or the `MEDIUM`
10+
//! string repeated 64x), and is around 40kb.
11+
//!
12+
//! Except for `mod emoji` (which is just a bunch of emoji), the strings were
13+
//! pulled from (localizations of) rust-lang.org.
14+
15+
macro_rules! repeat8 {
16+
($s:expr) => {
17+
concat!($s, $s, $s, $s, $s, $s, $s, $s)
18+
};
19+
}
20+
21+
macro_rules! define_consts {
22+
($s:literal) => {
23+
pub const MEDIUM: &str = $s;
24+
pub const LARGE: &str = repeat8!($s);
25+
pub const HUGE: &str = repeat8!(repeat8!(repeat8!($s)));
26+
};
27+
}
28+
29+
pub mod en {
30+
pub const SMALL: &str = "Mary had a little lamb, Little lamb";
31+
define_consts! {
32+
"Rust is blazingly fast and memory-efficient: with no runtime or garbage
33+
collector, it can power performance-critical services, run on embedded
34+
devices, and easily integrate with other languages. Rust’s rich type system
35+
and ownership model guarantee memory-safety and thread-safety — enabling you
36+
to eliminate many classes of bugs at compile-time. Rust has great
37+
documentation, a friendly compiler with useful error messages, and top-notch
38+
tooling — an integrated package manager and build tool, smart multi-editor
39+
support with auto-completion and type inspections, an auto-formatter, and
40+
more."
41+
}
42+
}
43+
44+
pub mod zh {
45+
pub const SMALL: &str = "度惊人且内存利用率极高";
46+
define_consts! {
47+
"Rust 速度惊人且内存利用率极高。由于\
48+
没有运行时和垃圾回收,它能够胜任对性能要\
49+
求特别高的服务,可以在嵌入式设备上运行,\
50+
还能轻松和其他语言集成。Rust 丰富的类型\
51+
系统和所有权模型保证了内存安全和线程安全,\
52+
让您在编译期就能够消除各种各样的错误。\
53+
Rust 拥有出色的文档、友好的编译器和清晰\
54+
的错误提示信息, 还集成了一流的工具——\
55+
包管理器和构建工具, 智能地自动补全和类\
56+
型检验的多编辑器支持, 以及自动格式化代\
57+
码等等。"
58+
}
59+
}
60+
61+
pub mod ru {
62+
pub const SMALL: &str = "Сотни компаний по";
63+
define_consts! {
64+
"Сотни компаний по всему миру используют Rust в реальных\
65+
проектах для быстрых кросс-платформенных решений с\
66+
ограниченными ресурсами. Такие проекты, как Firefox,\
67+
Dropbox и Cloudflare, используют Rust. Rust отлично\
68+
подходит как для стартапов, так и для больших компаний,\
69+
как для встраиваемых устройств, так и для масштабируемых\
70+
web-сервисов. Мой самый большой комплимент Rust."
71+
}
72+
}
73+
74+
pub mod emoji {
75+
pub const SMALL: &str = "😀😃😄😁😆😅🤣😂🙂🙃😉😊😇🥰😍🤩😘";
76+
define_consts! {
77+
"😀😃😄😁😆😅🤣😂🙂🙃😉😊😇🥰😍🤩😘😗☺😚😙🥲😋😛😜🤪😝🤑🤗🤭🤫🤔🤐🤨😐😑😶😶‍🌫️😏😒\
78+
🙄😬😮‍💨🤥😌😔😪🤤😴😷🤒🤕🤢🤮🤧🥵🥶🥴😵😵‍💫🤯��🥳🥸😎🤓🧐😕😟🙁☹😮😯😲😳🥺😦😧😨\
79+
😰😥😢😭😱😖😣😞😓😩😫🥱😤😡😠🤬😈👿💀☠💩🤡👹👺👻👽👾🤖😺😸😹😻😼😽🙀😿😾🙈🙉🙊\
80+
💋💌💘💝💖💗💓��💕💟❣💔❤️‍🔥❤️‍🩹❤🧡💛💚💙💜🤎🖤🤍💯💢💥💫💦💨🕳💬👁️‍🗨️🗨🗯💭💤👋\
81+
🤚🖐✋🖖👌🤌🤏✌"
82+
}
83+
}

0 commit comments

Comments
 (0)