Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ jobs:
wasmtime run "$wasm_file"
done

test-stable-riscv64:
name: Rust stable (riscv64gc-unknown-linux-gnu)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install RISC-V cross toolchain
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: riscv64gc-unknown-linux-gnu
runner: qemu-user
- name: Run tests
run: cargo test --verbose
Comment thread
liuq19 marked this conversation as resolved.
Outdated

test-nightly-hosted:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion src/lazyvalue/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl<'a> Debug for LazyValue<'a> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter
.debug_struct("LazyValue")
.field("raw json", &format_args!("{}", &self.as_raw_str()))
.field("raw json", &format_args!("{}", self.as_raw_str()))
.field("has_escaped", &self.inner.status)
.finish()
}
Expand Down
16 changes: 8 additions & 8 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ where
// ---- find separator: one u16 read to match `,"` or `}x` ----
let sep = self.read.peek_u16();
// Little-endian: `,"` = 0x222C, `}x` = (x << 8) | 0x7D
if sep == u16::from_le_bytes([b',', b'"']) {
if sep == u16::from_le_bytes(*b",\"") {
self.read.eat(2);
continue;
}
Expand Down Expand Up @@ -1404,7 +1404,7 @@ where

#[inline(always)]
fn skip_number_unsafe(&mut self) -> Result<()> {
let _ = self.get_next_token([b']', b'}', b','], 0);
let _ = self.get_next_token(*b"]},", 0);
Ok(())
}

Expand Down Expand Up @@ -1640,7 +1640,7 @@ where
}

// deal with the empty object
match self.get_next_token([b'"', b'}'], 1) {
match self.get_next_token(*b"\"}", 1) {
Some(b'"') => {}
Some(b'}') => return perr!(self, GetInEmptyObject),
None => return perr!(self, EofWhileParsing),
Expand Down Expand Up @@ -1677,7 +1677,7 @@ where
_ => {}
};
// optimize: direct find the next quote of key or object ending
match self.get_next_token([b'"', b'}'], 1) {
match self.get_next_token(*b"\"}", 1) {
Some(b'"') => continue,
Some(b'}') => return perr!(self, GetUnknownKeyInObject),
None => return perr!(self, EofWhileParsing),
Expand Down Expand Up @@ -1733,7 +1733,7 @@ where
_ => {}
};
// optimize: direct find the next token
match self.get_next_token([b']', b','], 1) {
match self.get_next_token(*b"],", 1) {
Some(b']') => return perr!(self, GetIndexOutOfArray),
Some(b',') => {
count -= 1;
Expand Down Expand Up @@ -1841,7 +1841,7 @@ where
_ => return perr!(self, ExpectObjectKeyOrEnd),
}
} else {
match self.get_next_token([b'"', b'}'], 1) {
match self.get_next_token(*b"\"}", 1) {
Some(b'"') => {}
Some(b'}') => return perr!(self, GetInEmptyObject),
None => return perr!(self, EofWhileParsing),
Expand Down Expand Up @@ -1882,7 +1882,7 @@ where
}
} else {
// optimize: direct find the next quote of key. or object ending
match self.get_next_token([b'"', b'}'], 1) {
match self.get_next_token(*b"\"}", 1) {
Some(b'"') => {}
Some(b'}') => break,
None => return perr!(self, EofWhileParsing),
Expand Down Expand Up @@ -1964,7 +1964,7 @@ where
}
} else {
// optimize: direct find the next token
match self.get_next_token([b']', b','], 1) {
match self.get_next_token(*b"],", 1) {
Some(b']') => break,
Some(b',') => {
index += 1;
Expand Down
Loading