Skip to content

Wrap arrayvec::ArrayString and fix arbitrary feature - #345

Closed
joaoantoniocardoso wants to merge 6 commits into
mavlink:masterfrom
joaoantoniocardoso:fix_string_arbitrary
Closed

Wrap arrayvec::ArrayString and fix arbitrary feature#345
joaoantoniocardoso wants to merge 6 commits into
mavlink:masterfrom
joaoantoniocardoso:fix_string_arbitrary

Conversation

@joaoantoniocardoso

@joaoantoniocardoso joaoantoniocardoso commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

Hi,

The arbitrary feature was already broken, but on the last PR (#343), I accidentally made it worse. For instance, the feature broke because it wasn't enabled in the CI.

To avoid having to rely on the arrayvec devs to implement Arbitrary the way we need, I'm wrapping arrayvec::ArrayString and calling it MavString. By doing so, we also gain better control over the API, making it possible to keep compatibility even if we decide to move from arrayvec to something else.

To help a bit on the API side, I implemented TryFrom<String> for MavString, too.


Closes #344

Comment thread mavlink-core/src/mavstring.rs
@joaoantoniocardoso
joaoantoniocardoso marked this pull request as draft July 3, 2025 00:39
@onur-ozkan
onur-ozkan self-requested a review July 3, 2025 13:21
- uses: dtolnay/rust-toolchain@stable
- name: Run internal tests
run: cargo test --verbose --features ${{ matrix.dialect }} ${{ matrix.signing }} -- --nocapture
run: cargo test --verbose --features arbitrary,${{ matrix.dialect }} ${{ matrix.signing }} -- --nocapture

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should arbitrary be enabled together with all the dialect features?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not necessarily now, but it will be used in their tests, soon.

@onur-ozkan

Copy link
Copy Markdown
Member

I will do the review once the draft mark is removed.

@joaoantoniocardoso

Copy link
Copy Markdown
Contributor Author

Closing this in favor of #376 + #377

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.

arbitrary feature is broken

2 participants