Skip to content

Commit 47b33b0

Browse files
Update dependencies and remove emoji stripping
1 parent 51313a6 commit 47b33b0

File tree

6 files changed

+25
-181
lines changed

6 files changed

+25
-181
lines changed

Cargo.lock

Lines changed: 20 additions & 127 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,26 @@ edition = "2021"
1515
twilight-http-ratelimiting = "0.15"
1616
twilight-model = "0.15"
1717
serde_json = "1.0"
18-
url = "2.2"
1918
bytes = "1"
20-
lru = "0.8"
19+
lru = "0.11"
2120
tracing = "0.1"
2221
tracing-subscriber = "0.3"
2322
async-trait = "0.1"
24-
emojis = "0.6"
25-
fxhash = "0.2"
2623

2724
[workspace.dependencies.once_cell]
2825
version = "1"
2926
default-features = false
3027

3128
[workspace.dependencies.hashbrown]
32-
version = "0.13"
29+
version = "0.14"
3330
features = ["serde"]
3431

3532
[workspace.dependencies.futures]
3633
version = "0.3"
3734
default-features = false
3835

3936
[workspace.dependencies.trust-dns-resolver]
40-
version = "0.21"
37+
version = "0.22"
4138
default-features = false
4239
features = ["tokio-runtime"]
4340

commons/Cargo.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ name = "commons"
33
version = "1.2.5"
44
edition.workspace = true
55

6-
[dependencies]
7-
emojis = "0.6"
8-
fxhash = "0.2"
9-
10-
11-
[dependencies.once_cell]
12-
version = "1"
13-
default-features = false
14-
156
[dependencies.serde]
167
version = "1.0"
178
features = ["rc", "derive"]

commons/src/util.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use fxhash::FxHashSet;
2-
use once_cell::sync::Lazy;
31
use serde::{Deserialize, Serialize};
42
use std::{num::NonZeroU64, ops::Add};
53

@@ -36,37 +34,3 @@ impl Add<u64> for Timestamp {
3634
unsafe { Self(NonZeroU64::new_unchecked(self.0.get() + rhs)) }
3735
}
3836
}
39-
40-
const EMOJI_ARRAY: [u32; 9280] = include!("../../emojis.txt");
41-
42-
static EMOJI_SET: Lazy<FxHashSet<u32>> = Lazy::new(|| EMOJI_ARRAY.iter().copied().collect());
43-
44-
pub fn strip_emoji(text: &str) -> String {
45-
text.chars()
46-
.filter(|&c| !EMOJI_SET.contains(&(c as u32)))
47-
.fold(String::with_capacity(text.len()), |mut acc, c| {
48-
if c.is_whitespace() || c.is_control() {
49-
acc.push(' ');
50-
} else {
51-
acc.push(c);
52-
}
53-
acc
54-
})
55-
}
56-
57-
#[cfg(test)]
58-
mod tests {
59-
use super::*;
60-
61-
#[test]
62-
fn test_strip_emoji() {
63-
assert_eq!(strip_emoji("no emoji"), "no emoji");
64-
assert_eq!(strip_emoji("simple smiley 😄"), "simple smiley ");
65-
assert_eq!(strip_emoji("with skin tone 👍🏽"), "with skin tone ");
66-
assert_eq!(strip_emoji("basic flag 🇩🇪 "), "basic flag ");
67-
assert_eq!(
68-
strip_emoji("simple | text - with $ special & chars %"),
69-
"simple | text - with $ special & chars %"
70-
);
71-
}
72-
}

discord-api/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ tracing = { workspace = true }
1010
serde_json = { workspace = true }
1111

1212
[dependencies.commons]
13-
version = "*"
1413
path = "../commons"
1514

1615
[dependencies.trust-dns-resolver]

0 commit comments

Comments
 (0)