Skip to content

Conversation

@redboltz
Copy link
Owner

No description provided.

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.90%. Comparing base (fe389da) to head (ca90ef4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #54   +/-   ##
=======================================
  Coverage   90.89%   90.90%           
=======================================
  Files          55       55           
  Lines        7460     7468    +8     
=======================================
+ Hits         6781     6789    +8     
  Misses        679      679           
Files with missing lines Coverage Δ
src/mqtt/packet/mqtt_binary.rs 94.38% <100.00%> (+0.40%) ⬆️
src/mqtt/packet/mqtt_string.rs 95.28% <100.00%> (+0.09%) ⬆️
src/mqtt/packet/property.rs 96.49% <100.00%> (ø)
src/mqtt/packet/sub_entry.rs 96.29% <100.00%> (ø)
src/mqtt/packet/v3_1_1/connect.rs 97.73% <100.00%> (ø)
src/mqtt/packet/v3_1_1/publish.rs 95.74% <100.00%> (ø)
src/mqtt/packet/v5_0/connect.rs 98.02% <100.00%> (ø)
src/mqtt/packet/v5_0/publish.rs 94.48% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

fn into_mqtt_string(self) -> Result<MqttString, MqttError> {
MqttString::new(self)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you don't mind me asking, why create a custom trait instead of using TryInto? It looks like there are already some TryInto implementations, so this using it would duplicating them. And there's already a blanket implementation for types TryInto themselves. I implemented it here: smaeul@800b960

Copy link
Owner Author

Choose a reason for hiding this comment

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

I took another look. Using TryInto is indeed the better solution, as you mentioned. I've force-pushed an update to the PR. Could you take a look at the updated version?

Copy link
Contributor

@smaeul smaeul left a comment

Choose a reason for hiding this comment

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

Looks good to me!

type Error = MqttError;

fn try_from(s: &String) -> Result<Self, Self::Error> {
MqttString::new(s.as_str())
Copy link
Contributor

Choose a reason for hiding this comment

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

I see the MqttBinary implementations use Self::new, whereas these use the concrete type, but this is a very minor inconsistency.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks. Fixed.

@redboltz redboltz merged commit 5350491 into main Nov 19, 2025
10 checks passed
@redboltz redboltz deleted the solve_52 branch November 19, 2025 11:28
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.

3 participants