Skip to content

Conversation

@jqnatividad
Copy link
Contributor

for library users who do not want the dependencies required by the cli

Linked Issue

Closes #39

Description

Gate deps required for cli tool behind cli feature.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Changes Made

Cargo.toml changes

  • add a cli feature and group cli-related dependencies under it
  • made the cli feature a required-feature for bin

lib.rs change

  • gated tui module behind cli feature

Testing

  • All existing tests pass
  • Added new tests for changes
  • Tests cover edge cases and spec compliance

Pre-submission Checklist

  • My code follows the project's coding standards
  • I have run code formatting/linting tools
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed
  • I have reviewed the TOON specification for relevant sections

Breaking Changes

  • No breaking changes
  • Breaking changes (describe migration path below)

for library users who do not want the dependencies required by the cli
@jqnatividad jqnatividad requested a review from a team as a code owner December 19, 2025 00:42
@shreyasbhat0
Copy link
Contributor

@jqnatividad can you fix the clippy errors

error: called `unwrap` on `result` after checking its variant with `is_ok`
  --> tests/spec_fixtures.rs:84:21
   |
80 |             if result.is_ok() {
   |             ----------------- help: try: `if let Ok(<item>) = result`
...
84 |                     result.unwrap()
   |                     ^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#unnecessary_unwrap
   = note: `-D clippy::unnecessary-unwrap` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_unwrap)]`
@jqnatividad jqnatividad marked this pull request as draft December 19, 2025 10:54
warning: this could be rewritten as `let...else`
   --> src/utils/string.rs:103:5
    |
103 | /     let first = match chars.next() {
104 | |         Some(c) => c,
105 | |         None => return false,
106 | |     };
    | |______^ help: consider writing: `let Some(first) = chars.next() else { return false };`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
warning: single-character string constant used as pattern
   --> src/utils/string.rs:145:22
    |
145 |     if s.starts_with("-") {
    |                      ^^^ help: consider using a `char`: `'-'`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
    = note: `-W clippy::single-char-pattern` implied by `-W clippy::pedantic`
    = help: to override `-W clippy::pedantic` add `#[allow(clippy::single_char_pattern)]`
warning: it is more concise to loop over references to containers instead of using explicit iteration methods
  --> src/utils/validation.rs:32:31
   |
32 |             for (key, val) in obj.iter() {
   |                               ^^^^^^^^^^ help: to write this more concisely, try: `obj`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
   = note: `-W clippy::explicit-iter-loop` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::explicit_iter_loop)]`

warning: it is more concise to loop over references to containers instead of using explicit iteration methods
  --> src/utils/validation.rs:38:24
   |
38 |             for val in arr.iter() {
   |                        ^^^^^^^^^^ help: to write this more concisely, try: `arr`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
@jqnatividad jqnatividad marked this pull request as ready for review December 19, 2025 11:09
@jqnatividad
Copy link
Contributor Author

Hi @shreyasbhat0 ,
Went ahead and took the liberty of applying select clippy::pedantic lints and corrected some typos as well.

@jqnatividad
Copy link
Contributor Author

FYI @shreyasbhat0 , I did cargo fmt but it changed 54 files so I didn't add it to the PR...

@jqnatividad
Copy link
Contributor Author

Aahhh... it seems it needs cargo +nightly fmt...

@shreyasbhat0
Copy link
Contributor

Yeah it needs cargo nightly fmt

@shreyasbhat0 shreyasbhat0 merged commit 04d179a into toon-format:main Dec 20, 2025
3 checks passed
@github-actions github-actions bot mentioned this pull request Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature flag components

2 participants