eclipse-uprotocol / eclipse-uprotocol/up-rust
Consider `UUri::try_from_parts_expanded_ue_id()`
Open
question
- Dominant language
- Rust
- Stars
- 26
- Forks
- 18
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 6
Description
It might be nice to have a version of `UUri::try_from_parts()` that accepts `ue_type` and `ue_instance` as two separate parameters to avoid the kinds of bit shifting and or'ing seen [here](https://github.com/eclipse-uprotocol/up-transport-iceoryx2-rust/pull/71/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R128-R131):
```rust
fn test_uri(authority: &str, instance: u16, typ: u16, version: u8, resource: u16) -> UUri {
let entity_id = ((instance as u32) << 16) | (typ as u32);
UUri::try_from_parts(authority, entity_id, version, resource).unwrap()
}
```
Contributor guide
Assessment
This issue has not been assessed yet.