Skip to content

Commit d01e2d3

Browse files
committed
Fix rust compile
1 parent b23a9e2 commit d01e2d3

3 files changed

Lines changed: 2 additions & 2 deletions

File tree

crates/string-offsets/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exclude = ["/js"]
1313
[lib]
1414
crate-type = ["cdylib", "rlib"]
1515

16-
[target.'cfg(target_arch = "wasm32")'.dependencies]
16+
[dependencies]
1717
wasm-bindgen = "0.2"
1818

1919
[dev-dependencies]

crates/string-offsets/js/test/test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe('StringOffsets sanity checks', () => {
1818
expect(offsets.lines()).toBe(2);
1919
// ☀️ is 6 UTF-8 bytes and 3 UTF-16 code units
2020
expect(offsets.utf8_to_utf16(6)).toBe(2);
21-
// expect(offsets.utf16ToUtf8(3)).toBe(6);
2221
expect(offsets.utf8_to_utf16(0)).toBe(0);
2322
});
2423
});

crates/string-offsets/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ impl StringOffsets {
148148
///
149149
/// If `content` is UTF-8, this is just like [`StringOffsets::new`]. Otherwise, the
150150
/// conversion methods will produce unspecified (but memory-safe) results.
151+
#[allow(unused_variables)]
151152
#[wasm_bindgen(static_method_of = StringOffsets)]
152153
pub fn from_bytes(content: &[u8]) -> Self {
153154
new_converter(content)

0 commit comments

Comments
 (0)