Skip to content

Commit ed702de

Browse files
committed
chore: exclude global_alloc on linux-aarch64-musl
1 parent 84c0a6d commit ed702de

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

crates/alloc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ version = "0.1.0"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

8-
[target.'cfg(not(all(target_os = "windows", target_arch = "aarch64")))'.dependencies]
8+
[target.'cfg(all(not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl")), not(all(target_os = "windows", target_arch = "aarch64"))))'.dependencies]
99
mimalloc-rust = {version = "0.1"}

crates/alloc/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#[cfg(all(
22
not(debug_assertions),
3-
not(all(target_os = "windows", target_arch = "aarch64"))
3+
not(all(target_os = "windows", target_arch = "aarch64")),
4+
not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl")),
45
))]
56
#[global_allocator]
67
static ALLOC: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc;

packages/jieba/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/// Explicit extern crate to use allocator.
55
extern crate global_alloc;
66

7-
use std::convert::TryInto;
87
use std::str;
98

109
use jieba_rs::{Jieba, KeywordExtract, TFIDF};
@@ -154,7 +153,7 @@ fn extract(ctx: CallContext) -> Result<JsObject> {
154153
TFIDF::new_with_jieba(jieba)
155154
});
156155

157-
let topn: u32 = topn.try_into()?;
156+
let topn: u32 = topn.get_uint32()?;
158157

159158
let tags = keyword_extractor.extract_tags(
160159
str::from_utf8(&sentence).map_err(|_| Error::from_status(Status::InvalidArg))?,

0 commit comments

Comments
 (0)