Skip to content

Implement LinearSet, a LinearMap wrapped to have set semantics - #714

Open
mikwielgus wants to merge 2 commits into
rust-embedded:mainfrom
mikwielgus:linear_set
Open

mikwielgus wants to merge 2 commits into
rust-embedded:mainfrom
mikwielgus:linear_set

Conversation

@mikwielgus

@mikwielgus mikwielgus commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

To note: though I created LinearSetView alias analogously
to LinearMapView because I was copypasting from linear_map, to
keep this simpler I haven't added .as_view() and .as_mut_view()
interfaces yet.

Closes #699

@mikwielgus
mikwielgus force-pushed the linear_set branch 3 times, most recently from 5fa3fc6 to 4ec16d0 Compare November 15, 2026 17:52
@sgued

sgued commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Thank you for this, I'll review this once 0.9.4 is released given that it must be released ASAP and I don't want to delay it.

No unit tests yet (will follow in the next commit).

To note: though I have created `LinearSetView` alias analogously
to `LinearMapView` because I was copypasting from `linear_map`, to
keep this simpler I haven't added `.as_view()` and `.as_mut_view()`
interfaces yet.

Closes rust-embedded#699
@mikwielgus
mikwielgus force-pushed the linear_set branch 3 times, most recently from d111383 to c7f5f3d Compare November 15, 2026 18:11

@sgued sgued left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the PR, this is overall good but please add the as_view() and as_mut_view() method, correct the docs here and there, and fix the couple of nitpicks I have (I prefer explicitely marking that values are irrelevant by decontsructing them into () than using _ ).

I haven't checked the tests yet.

Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
Comment thread src/linear_set.rs Resolved
@mikwielgus

Copy link
Copy Markdown
Contributor Author

Changes from source code comments done.

please add the as_view() and as_mut_view() method

If I may ask, I would like to split this part into a future PR (likely soon to follow). LinearMap initially did not have these functions either. It would be more convenient for me this way.

This branch has not been deployed

No deployments
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.

Add LinearSet -- LinearMap with set semantics

2 participants