Skip to content

Commit c89e386

Browse files
committed
msrv 1.80 support (incl. derivre bump)
1 parent 35b74b2 commit c89e386

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

.github/workflows/rust.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,20 @@ jobs:
5252
with:
5353
name: wheels
5454
path: target/wheels/*
55+
56+
msrv:
57+
name: MSRV Check
58+
59+
runs-on: ubuntu-latest
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Set up Rust
65+
uses: dtolnay/[email protected]
66+
with:
67+
components: clippy
68+
69+
- name: Build parser
70+
run: cargo build --verbose --locked
71+
working-directory: parser

Cargo.lock

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

parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/guidance-ai/llguidance"
88

99
[dependencies]
1010
toktrie = { workspace = true }
11-
derivre = { version = "=0.3.7", default-features = false, features = ["compress"] }
11+
derivre = { version = "=0.3.8", default-features = false, features = ["compress"] }
1212
serde = { version = "1.0.217", features = ["derive"] }
1313
serde_json = { version = "1.0.138", features = ["preserve_order"] }
1414
anyhow = "1.0.95"

parser/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fn main() {
55

66
let required_vars = [
77
"CARGO",
8-
"CARGO_MANIFEST_PATH",
8+
// "CARGO_MANIFEST_PATH",
99
"CARGO_PKG_NAME",
1010
"CARGO_PKG_VERSION",
1111
"OUT_DIR",

parser/src/ffi.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,12 @@ pub extern "C" fn llg_get_temperature(cc: &LlgConstraint) -> f32 {
554554
/// Check if constraint is stopped (cannot be extended further).
555555
#[no_mangle]
556556
pub extern "C" fn llg_is_stopped(cc: &LlgConstraint) -> bool {
557-
cc.constraint
558-
.as_ref()
559-
.is_none_or(|c| c.step_result().is_stop())
557+
if let Some(c) = &cc.constraint {
558+
c.step_result().is_stop()
559+
} else {
560+
// if there is no constraint, we consider it stopped
561+
true
562+
}
560563
}
561564

562565
/// Compute mask for the next token sampling

0 commit comments

Comments
 (0)