Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/communication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl UPayload {
/// # Errors
///
/// * Err(`UMessageError`) if the unpacking process fails, for example if the payload could
/// not be deserialized into the target type `T`.
/// not be deserialized into the target type `T`.
///
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion src/umessage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl UMessage {
/// # Errors
///
/// * Err(`UMessageError`) if the unpacking process fails, for example if the payload could
/// not be deserialized into the target type `T`.
/// not be deserialized into the target type `T`.
pub fn extract_protobuf<T: MessageFull + Default>(&self) -> Result<T, UMessageError> {
if let Some(payload) = &self.payload {
let payload_format = self.attributes.payload_format.enum_value_or_default();
Expand Down
14 changes: 12 additions & 2 deletions src/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ impl UUri {
self.eq(&UUri::default())
}

/// Check if an `UUri` is remote, by comparing authority fields.
/// Check if an `UUri` is remote, by comparing authority fields. UUris with empty authority are
/// considered to be local.
///
/// # Returns
///
Expand All @@ -404,9 +405,18 @@ impl UUri {
/// let authority_a = UUri::from_str("up://Authority.A/100A/1/0").unwrap();
/// let authority_b = UUri::from_str("up://Authority.B/200B/2/20").unwrap();
/// assert!(authority_a.is_remote_authority(&authority_b));
///
/// let authority_local = UUri::from_str("up:///100A/1/0").unwrap();
/// assert!(!authority_local.is_remote_authority(&authority_a));
///
/// let authority_wildcard = UUri::from_str("up://*/100A/1/0").unwrap();
/// assert!(!authority_wildcard.is_remote_authority(&authority_a));
/// assert!(!authority_a.is_remote_authority(&authority_wildcard));
/// assert!(!authority_wildcard.is_remote_authority(&authority_wildcard));
/// ````
pub fn is_remote_authority(&self, other_uri: &UUri) -> bool {
self.authority_name != WILDCARD_AUTHORITY
!self.authority_name.is_empty()
&& self.authority_name != WILDCARD_AUTHORITY
&& other_uri.authority_name != WILDCARD_AUTHORITY
&& self.authority_name != other_uri.authority_name
}
Expand Down
2 changes: 1 addition & 1 deletion src/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl FromStr for UUID {
///
/// Returns an error
/// * if the given string does not represent a UUID as defined by
/// [RFC 4122, Section 3](https://www.rfc-editor.org/rfc/rfc4122.html#section-3), or
/// [RFC 4122, Section 3](https://www.rfc-editor.org/rfc/rfc4122.html#section-3), or
/// * if the bytes encoded in the string contain an invalid version and/or variant identifier.
///
/// # Examples
Expand Down