Skip to content

chore: remove unmaintained boolinator dep#968

Closed
anikettuli wants to merge 2 commits intoStremio:developmentfrom
anikettuli:claude/remove-boolinator-dep
Closed

chore: remove unmaintained boolinator dep#968
anikettuli wants to merge 2 commits intoStremio:developmentfrom
anikettuli:claude/remove-boolinator-dep

Conversation

@anikettuli
Copy link
Copy Markdown

@anikettuli anikettuli commented Apr 20, 2026

Summary

Remove the boolinator crate (unmaintained since 2016 — last release August 2016) from the workspace. Replace its Boolinator::as_option / as_some extension methods on bool with stdlib equivalents (bool::then, bool::then_some).

Why this change

  • boolinator is unmaintained (no commits in 9+ years); rustsec has flagged it as a stale dependency in the past.
  • bool::then (stable since Rust 1.50, May 2021) and bool::then_some (stable since Rust 1.62, June 2022) cover every call site. No third-party dep needed.
  • Shrinks the dependency graph by one crate; Cargo.lock no longer resolves boolinator 2.4.0.

Effect

  • One fewer transitive dependency: slightly faster clean builds, fewer vectors for supply-chain staleness alerts.
  • No behavior change: the replacements are semantically identical. bool::then(F) returns Some(F()) when true; as_option(x) returned Some(x) when true — equivalent except then accepts a closure so side-effectful arguments only execute on the truthy branch (never the case here).
  • No public API / no serialized-shape / no wire-format changes. This is an internal refactor only.

Call sites updated

  • src/models/catalog_with_filters.rs(!extra_prop.is_required).as_option().map(|_| SelectableExtraOption { .. })(!extra_prop.is_required).then(|| SelectableExtraOption { .. })
  • src/types/resource/stream.rs (Stream::youtube) — cond.as_option().and_then(|_| split)cond.then(|| split).flatten()
  • stremio-core-web/src/model/serialize_discover.rs(!discover.catalog.is_empty()).as_option().map(|_| ..).then(|| ..)

Manifest changes:

  • Cargo.toml — drop boolinator = "2.4"
  • stremio-core-web/Cargo.toml — drop boolinator = "2.4.*"
  • Cargo.lock — regenerated (removes the boolinator entry)

Test plan

Verified locally on Windows 11 with rustc 1.95.0 stable-x86_64-pc-windows-gnu:

  • cargo test -p stremio-core --lib202 passed, 0 failed
  • cargo clippy -p stremio-core --all-targets -- -D warnings — clean
  • cargo fmt --check — clean (fixup commit 082e3f63f applies the formatting that cargo fmt requested after the .then(..) rewrite)

Full-workspace build (including stremio-core-web) needs the wasm-bindgen upgrade in #969 because wasm-bindgen 0.2.78 is incompatible with current Rust.

Replace `boolinator::Boolinator` extension methods with stdlib equivalents
(`bool::then`, `bool::then_some`). The crate has been unmaintained since
2016 and its functionality is covered by stable std since Rust 1.50/1.62.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 20, 2026 04:06
@github-actions
Copy link
Copy Markdown

stremio-core-web prebuild

Prebuild artifact published by the Build workflow for branch claude/remove-boolinator-dep.

Paste one of these into stremio-web's package.json and run pnpm install to wire this prebuild into a corresponding stremio-web PR:

Release

"@stremio/stremio-core-web": "https://stremio.github.io/stremio-core/stremio-core-web/claude/remove-boolinator-dep/stremio-stremio-core-web-0.56.3.tgz"

Dev

"@stremio/stremio-core-web": "https://stremio.github.io/stremio-core/stremio-core-web/claude/remove-boolinator-dep/dev/stremio-stremio-core-web-0.56.3.tgz"

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the unmaintained boolinator crate from the workspace and replaces its Boolinator bool extension methods with Rust stdlib equivalents (bool::then and Option::flatten) to preserve behavior without the external dependency.

Changes:

  • Removed boolinator from workspace and stremio-core-web dependencies.
  • Replaced as_option() call sites with bool::then(...) (and one then(...).flatten() case).
  • Dropped boolinator::Boolinator imports from affected Rust modules.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Removes boolinator from workspace/root dependencies.
stremio-core-web/Cargo.toml Removes boolinator from stremio-core-web dependencies.
src/models/catalog_with_filters.rs Replaces as_option().map(...) with `then(
src/types/resource/stream.rs Replaces as_option().and_then(...) with `then(
stremio-core-web/src/model/serialize_discover.rs Replaces as_option().map(...) with `then(

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Cargo.toml
Comment on lines 71 to 75
either = "1.6"
enclose = "1.1"
derivative = "2.2"
derive_more = { version = "2", features = ["from", "into", "into_iterator", "try_into", "deref"] }
boolinator = "2.4"
strum = { version = "0.27", features = ["derive"] }
- cargo fmt collapses the shorter .then(|| ...) call in catalog_with_filters.rs
- Cargo.lock now reflects boolinator's absence from the dependency tree
@anikettuli
Copy link
Copy Markdown
Author

Superseded by #973 — the five dead-weight/MSRV modernizations are bundled there to avoid five near-identical Cargo.toml / Cargo.lock merges. Each change remains a distinct commit for piecewise review.

@anikettuli anikettuli closed this Apr 20, 2026
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.

2 participants