Fix nightly warnings about lifetimes - #25
Conversation
Also allow optional no-fmt compilation of demos
Reviewer's GuideThis PR refines picojson’s parser APIs by adding explicit lifetimes to Event returns to satisfy the compiler, and enhances the AVR demo examples with optional no-fmt support and safer status handling in JSON parsing. Class diagram for updated Event and PullParser lifetimesclassDiagram
class Event {
<<lifetime: 'a, 'b>>
// ... (fields omitted)
}
class PullParser {
+next(&mut self) -> Option<Result<Event<'_, '_>, ParseError>>
+next_event(&mut self) -> Result<Event<'_, '_>, ParseError>
}
class StreamParser {
<<lifetime: 'b, R, C>>
+next_event_impl(&mut self) -> Result<Event<'_, '_>, ParseError>
+extract_number_from_state(&mut self) -> Result<Event<'_, '_>, ParseError>
+extract_string_from_state(&mut self) -> Result<Event<'_, '_>, ParseError>
+create_unescaped_string(&mut self) -> Result<Event<'_, '_>, ParseError>
+create_borrowed_string(&mut self, start_pos: usize) -> Result<Event<'_, '_>, ParseError>
+extract_key_from_state(&mut self) -> Result<Event<'_, '_>, ParseError>
+create_unescaped_key(&mut self) -> Result<Event<'_, '_>, ParseError>
+create_borrowed_key(&mut self, start_pos: usize) -> Result<Event<'_, '_>, ParseError>
+extract_number_from_state_with_context(&mut self, from_container_end: bool) -> Result<Event<'_, '_>, ParseError>
}
class SliceParser {
<<lifetime: 'a, 'b, C>>
+parse_number_event(&mut self, start: usize, from_container_end: bool) -> Result<Event<'_, '_>, ParseError>
+handle_simple_escape_token(&mut self, escape_token: &EventToken) -> Result<Option<Event<'_, '_>>, ParseError>
+handle_escape_event(&mut self, escape_char: u8) -> Result<Option<Event<'_, '_>>, ParseError>
+next_event_impl(&mut self) -> Result<Event<'_, '_>, ParseError>
}
class CopyOnEscape {
<<lifetime: 'a, 'b>>
+end_string(&mut self, pos: usize) -> Result<String<'_, '_>, ParseError>
}
class NumberParser {
+parse_number_event<T: NumberExtractor>(extractor: &T, start_pos: usize, from_container_end: bool) -> Result<Event<'_, '_>, ParseError>
}
PullParser <|.. StreamParser
PullParser <|.. SliceParser
Class diagram for Event and String with explicit lifetimesclassDiagram
class Event {
<<lifetime: 'a, 'b>>
// ... (fields omitted)
}
class String {
<<lifetime: 'a, 'b>>
// ... (fields omitted)
}
class CopyOnEscape {
+end_string(&mut self, pos: usize) -> Result<String<'a, 'b>, ParseError>
}
Event <.. CopyOnEscape : returns
String <.. CopyOnEscape : returns
Class diagram for PullParser trait with updated next and next_event methodsclassDiagram
class PullParser {
+next(&mut self) -> Option<Result<Event<'_, '_>, ParseError>>
+next_event(&mut self) -> Result<Event<'_, '_>, ParseError>
}
class StreamParser
class SliceParser
PullParser <|.. StreamParser
PullParser <|.. SliceParser
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
""" WalkthroughThis update introduces explicit lifetime annotations to the Changes
Sequence Diagram(s)sequenceDiagram
participant Main as main()
participant Serial as Serial (optional)
participant Parser as Parser
participant Buffer as Scratch Buffer
Main->>Parser: Parse JSON input
Parser->>Buffer: Copy/extract "status" safely
Parser-->>Main: Return parse result
alt Serial enabled (ufmt feature)
Main->>Serial: Initialize Serial
Main->>Serial: Print parse result and status
else Serial disabled
Main->>Main: No serial output
end
Possibly related PRs
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Summary of Changes
Hello @kaidokert, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily addresses compiler warnings encountered with nightly Rust builds by explicitly defining lifetimes for data types within the picojson library. It also enhances the flexibility of demo application builds by allowing them to compile without the ufmt feature, which disables serial output. Minor improvements to demo output and slice handling are also included.
Highlights
- Lifetime Fixes: Explicitly specified lifetimes for
EventandStringtypes in various methods across thepicojsoncrate (copy_on_escape.rs,number_parser.rs,shared.rs,slice_parser.rs,stream_parser.rs) to resolve nightly compiler warnings related to lifetime inference. - Conditional Demo Compilation: Introduced conditional compilation (
#[cfg(feature = "ufmt")]) and a stub macro foruwriteln!inavr_demo/examples/test_picojson.rsandavr_demo/examples/test_serde.rs. This allows the demo applications to be compiled without theufmtfeature, effectively disabling serial output whenufmtis not enabled. - Safer Slice Access: Improved robustness in
avr_demo/examples/test_picojson.rsby changing direct slice access (scratch[..status_len]) to usescratch.get_mut(..status_len), preventing potential panics if the requested slice goes out of bounds. - Enhanced Demo Output: Added printing of the parsed
statusfield to the serial output in bothavr_demo/examples/test_picojson.rsandavr_demo/examples/test_serde.rs.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Hey @kaidokert - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request effectively addresses several points: it fixes nightly compiler warnings by specifying explicit lifetimes, allows demo applications to be built without the ufmt feature, and enhances the safety of JSON parsing in the demos. The lifetime fixes are applied consistently across the picojson crate. The conditional compilation for ufmt is well-handled with a macro stub. The safety improvements in the demo code, such as using get_mut and get to avoid potential panics, are excellent. I have one suggestion to improve code conciseness.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
picojson/src/slice_parser.rs (1)
196-200:handle_escape_eventkeeps returningOk(None)– considerResult<(), _>
handle_escape_eventwill never propagate anEvent, yet its return type isResult<Option<Event<'_, '_>>, ParseError>.
Changing it toResult<(), ParseError>would simplify the call-site pattern‐matching that always discards theNone.-fn handle_escape_event( - &mut self, - escape_char: u8, -) -> Result<Option<Event<'_, '_>>, ParseError> { +fn handle_escape_event( + &mut self, + escape_char: u8, +) -> Result<(), ParseError> { … - Ok(None) + Ok(()) }picojson/src/stream_parser.rs (1)
127-131: Consistent lifetime annotations, but consider a local aliasEvery internal helper now repeats
Result<Event<'_, '_>, ParseError>.
A single type alias would reduce noise and future diff size:use crate::shared::{ContentRange, Event, ParseError, …}; +type JsonEvent<'a, 'b> = Event<'a, 'b>; … -fn next_event_impl(&mut self) -> Result<Event<'_, '_>, ParseError> { +fn next_event_impl(&mut self) -> Result<JsonEvent<'_, '_>, ParseError> {Optional, but improves readability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
avr_demo/examples/test_picojson.rs(4 hunks)avr_demo/examples/test_serde.rs(3 hunks)picojson/src/copy_on_escape.rs(1 hunks)picojson/src/number_parser.rs(1 hunks)picojson/src/shared.rs(1 hunks)picojson/src/slice_parser.rs(5 hunks)picojson/src/stream_parser.rs(7 hunks)
🧰 Additional context used
🧠 Learnings (7)
picojson/src/number_parser.rs (3)
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: tokenizer/src/bitstack/mod.rs:0-0
Timestamp: 2025-06-28T23:43:22.754Z
Learning: In the picojson-rs project, the BitStack trait was redesigned to return bool instead of Option<bool> for pop() and top() methods. Empty stacks return false rather than None, which simplifies the API and avoids Option handling.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: stax/src/flex_parser.rs:0-0
Timestamp: 2025-06-28T18:12:29.968Z
Learning: In the stax JSON parser codebase, EscapeSequence event handlers exist in flex_parser.rs not because they're needed by that parser variant, but to avoid catch-all patterns in match statements. The flex parser doesn't need to process EscapeSequence events, but the other parser variant (direct parser) does need them.
picojson/src/shared.rs (3)
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: tokenizer/src/bitstack/mod.rs:0-0
Timestamp: 2025-06-28T23:43:22.754Z
Learning: In the picojson-rs project, the BitStack trait was redesigned to return bool instead of Option<bool> for pop() and top() methods. Empty stacks return false rather than None, which simplifies the API and avoids Option handling.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: stax/src/flex_parser.rs:0-0
Timestamp: 2025-06-28T18:12:29.968Z
Learning: In the stax JSON parser codebase, EscapeSequence event handlers exist in flex_parser.rs not because they're needed by that parser variant, but to avoid catch-all patterns in match statements. The flex parser doesn't need to process EscapeSequence events, but the other parser variant (direct parser) does need them.
avr_demo/examples/test_picojson.rs (4)
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: tokenizer/src/bitstack/mod.rs:0-0
Timestamp: 2025-06-28T23:43:22.754Z
Learning: In the picojson-rs project, the BitStack trait was redesigned to return bool instead of Option<bool> for pop() and top() methods. Empty stacks return false rather than None, which simplifies the API and avoids Option handling.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: stax/src/lib.rs:19-21
Timestamp: 2025-06-28T18:14:22.845Z
Learning: In Rust crate organization, functions can be imported into lib.rs via `use` statements not for direct usage within lib.rs itself, but to make them available to other modules within the same crate via the `crate::` path. This is a valid pattern and such imports should not be flagged as unused even if lib.rs doesn't directly call them.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#18
File: avr_demo/src/stack_measurement.rs:39-39
Timestamp: 2025-07-02T06:17:39.995Z
Learning: In AVR stack measurement implementations for ATmega2560, when the stack grows downward from RAMEND and watermark scanning finds the first overwritten byte at current_ptr, the calculation `RAMEND_ADDR - current_ptr` correctly reports actual stack usage (bytes consumed), not remaining bytes. This pattern is used in the picojson-rs avr_demo stack measurement module.
avr_demo/examples/test_serde.rs (4)
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: tokenizer/src/bitstack/mod.rs:0-0
Timestamp: 2025-06-28T23:43:22.754Z
Learning: In the picojson-rs project, the BitStack trait was redesigned to return bool instead of Option<bool> for pop() and top() methods. Empty stacks return false rather than None, which simplifies the API and avoids Option handling.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: stax/src/lib.rs:19-21
Timestamp: 2025-06-28T18:14:22.845Z
Learning: In Rust crate organization, functions can be imported into lib.rs via `use` statements not for direct usage within lib.rs itself, but to make them available to other modules within the same crate via the `crate::` path. This is a valid pattern and such imports should not be flagged as unused even if lib.rs doesn't directly call them.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#18
File: avr_demo/src/stack_measurement.rs:39-39
Timestamp: 2025-07-02T06:17:39.995Z
Learning: In AVR stack measurement implementations for ATmega2560, when the stack grows downward from RAMEND and watermark scanning finds the first overwritten byte at current_ptr, the calculation `RAMEND_ADDR - current_ptr` correctly reports actual stack usage (bytes consumed), not remaining bytes. This pattern is used in the picojson-rs avr_demo stack measurement module.
picojson/src/copy_on_escape.rs (3)
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: tokenizer/src/bitstack/mod.rs:0-0
Timestamp: 2025-06-28T23:43:22.754Z
Learning: In the picojson-rs project, the BitStack trait was redesigned to return bool instead of Option<bool> for pop() and top() methods. Empty stacks return false rather than None, which simplifies the API and avoids Option handling.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: stax/src/flex_parser.rs:0-0
Timestamp: 2025-06-28T18:12:29.968Z
Learning: In the stax JSON parser codebase, EscapeSequence event handlers exist in flex_parser.rs not because they're needed by that parser variant, but to avoid catch-all patterns in match statements. The flex parser doesn't need to process EscapeSequence events, but the other parser variant (direct parser) does need them.
picojson/src/slice_parser.rs (3)
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: stax/src/flex_parser.rs:0-0
Timestamp: 2025-06-28T18:12:29.968Z
Learning: In the stax JSON parser codebase, EscapeSequence event handlers exist in flex_parser.rs not because they're needed by that parser variant, but to avoid catch-all patterns in match statements. The flex parser doesn't need to process EscapeSequence events, but the other parser variant (direct parser) does need them.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: tokenizer/src/bitstack/mod.rs:0-0
Timestamp: 2025-06-28T23:43:22.754Z
Learning: In the picojson-rs project, the BitStack trait was redesigned to return bool instead of Option<bool> for pop() and top() methods. Empty stacks return false rather than None, which simplifies the API and avoids Option handling.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
picojson/src/stream_parser.rs (3)
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: stax/src/flex_parser.rs:0-0
Timestamp: 2025-06-28T18:12:29.968Z
Learning: In the stax JSON parser codebase, EscapeSequence event handlers exist in flex_parser.rs not because they're needed by that parser variant, but to avoid catch-all patterns in match statements. The flex parser doesn't need to process EscapeSequence events, but the other parser variant (direct parser) does need them.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#1
File: tokenizer/src/bitstack/mod.rs:0-0
Timestamp: 2025-06-28T23:43:22.754Z
Learning: In the picojson-rs project, the BitStack trait was redesigned to return bool instead of Option<bool> for pop() and top() methods. Empty stacks return false rather than None, which simplifies the API and avoids Option handling.
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
🧬 Code Graph Analysis (3)
picojson/src/shared.rs (2)
picojson/src/slice_parser.rs (1)
next_event(449-451)picojson/src/stream_parser.rs (1)
next_event(599-601)
picojson/src/slice_parser.rs (2)
picojson/src/stream_parser.rs (2)
next_event_impl(127-316)next_event(599-601)picojson/src/shared.rs (1)
next_event(117-117)
picojson/src/stream_parser.rs (2)
picojson/src/slice_parser.rs (2)
next_event_impl(260-445)next_event(449-451)picojson/src/shared.rs (2)
bytes_to_utf8_str(220-222)next_event(117-117)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: AVR Panic Prevention
- GitHub Check: Run AVR Test Suites
- GitHub Check: AVR Panic Prevention
- GitHub Check: Run AVR Test Suites
🔇 Additional comments (17)
avr_demo/examples/test_serde.rs (3)
9-21: LGTM: Well-implemented conditional compilation for ufmt feature.The conditional import and fallback stub macro correctly handle cases where ufmt is not available. The stub macro returns the appropriate type signature
Ok::<(), core::convert::Infallible>()that matches the expecteduwriteln!return type.
32-37: LGTM: Proper conditional serial initialization.Serial interface initialization is correctly guarded by the ufmt feature flag, preventing unnecessary resource allocation when formatting is disabled.
50-50: LGTM: Enhanced debug output.The addition of status field printing provides better debugging information for JSON parsing verification.
picojson/src/number_parser.rs (1)
36-36: LGTM: Explicit lifetime annotations added to fix nightly warnings.The return type now includes explicit lifetime parameters
Event<'_, '_>which addresses nightly Rust compiler warnings about lifetime elision. This change maintains the same functionality while improving type clarity.picojson/src/copy_on_escape.rs (1)
155-155: LGTM: Consistent lifetime annotation for String return type.The explicit lifetime parameters
String<'_, '_>align with the broader effort to fix nightly compiler warnings about lifetime elision. This change maintains API compatibility while improving type precision.picojson/src/shared.rs (2)
109-109: LGTM: Updated trait method signature with explicit lifetimes.The
next()method now returnsEvent<'_, '_>with explicit lifetime parameters, ensuring consistency with the broader lifetime annotation effort across the codebase.
117-117: LGTM: Consistent trait signature for next_event method.The explicit lifetime parameters in the return type ensure that implementers of this trait (like SliceParser and StreamParser shown in the relevant code snippets) maintain proper borrowing semantics.
avr_demo/examples/test_picojson.rs (5)
12-21: LGTM: Consistent conditional compilation pattern.The conditional import and stub macro implementation matches the pattern used in
test_serde.rs, providing proper fallback behavior when ufmt is not available.
67-69: LGTM: Safe buffer access replaces unsafe indexing.Using
get_mut()instead of direct slice indexing prevents potential panics if the buffer is too small, improving the robustness of the code.
90-96: LGTM: Proper error handling for string extraction.The safe string extraction using
get()and proper UTF-8 validation with a sensible fallback to empty string is much safer than the previous approach that could panic.
107-112: LGTM: Conditional serial initialization.Serial interface initialization is properly guarded by the ufmt feature flag, consistent with the pattern used in
test_serde.rs.
125-125: LGTM: Enhanced debug output for status field.The additional debug print provides better visibility into the parsed JSON structure for testing and verification purposes.
picojson/src/slice_parser.rs (3)
175-188: Lifetime-annotated results look correctAll helper methods now return
Result<Event<'_, '_>, ParseError>(orOption<Event<'_, '_>>).
This aligns with the newPullParsertrait signature and keeps borrowing constraints explicit. No other changes required.
260-260: Signature refreshed – no issues
next_event_implnow advertises the explicit lifetimes. Implementation already satisfied the borrow checker via elision; this is purely syntactic and fine.
449-450: Trait method matches updatedPullParsercontractThe forwarding implementation compiles unchanged. ✅
picojson/src/stream_parser.rs (2)
323-327: Return-type updates are mechanically correctAll extraction helpers now propagate explicit lifetimes; implementation logic untouched. No regressions spotted.
Also applies to: 329-341, 345-349, 352-362, 365-377, 381-385, 388-398, 405-413
598-601: Forwarding impl remains correct
next_eventsimply delegates; lifetimes now explicit and consistent with the trait.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
avr_demo/run_suite.py (1)
33-35: Fix formatting: Add missing whitespace after commas.The Python style guide (PEP 8) requires spaces after commas in lists.
- ("picojson-tiny", "test_picojson", ["pico-tiny","ufmt"]), - ("picojson-small", "test_picojson", ["pico-small","ufmt"]), - ("picojson-huge", "test_picojson", ["pico-huge","ufmt"]), + ("picojson-tiny", "test_picojson", ["pico-tiny", "ufmt"]), + ("picojson-small", "test_picojson", ["pico-small", "ufmt"]), + ("picojson-huge", "test_picojson", ["pico-huge", "ufmt"]),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
avr_demo/run_suite.py(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kaidokert
PR: kaidokert/picojson-rs#5
File: picojson/src/lib.rs:0-0
Timestamp: 2025-06-29T17:48:18.188Z
Learning: In the picojson-rs project, the `use tokenizer as ujson;` alias in lib.rs is a transitionary and fully internal private alias used during crate reorganization. Examples and external code no longer depend on this alias, making the private visibility appropriate.
🪛 Flake8 (7.2.0)
avr_demo/run_suite.py
[error] 33-33: missing whitespace after ','
(E231)
[error] 34-34: missing whitespace after ','
(E231)
[error] 35-35: missing whitespace after ','
(E231)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: AVR Panic Prevention
- GitHub Check: Run AVR Test Suites
- GitHub Check: Run AVR Test Suites
- GitHub Check: AVR Panic Prevention
🔇 Additional comments (1)
avr_demo/run_suite.py (1)
32-35: Good alignment with conditional compilation changes.The addition of
"ufmt"feature to all test configurations properly supports the conditional compilation changes mentioned in the PR objectives. This ensures consistent feature availability across all demo configurations.
Also allow optional no-fmt compilation of demos
Summary by Sourcery
Enable building demos without the ufmt feature, fix nightly compiler warnings by parameterizing parser events with explicit lifetimes, and improve demo JSON status handling.
New Features:
Bug Fixes:
Enhancements:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor