Skip to content

Commit

Permalink
change SDP.attribute to Opton<&str>
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Feb 17, 2024
1 parent 22defe6 commit 5260d38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sctp/src/association/association_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ fn test_assoc_handle_init() -> Result<()> {

#[test]
fn test_assoc_max_message_size_default() -> Result<()> {
let mut a = create_association(TransportConfig::default());
let mut a = create_association(TransportConfig::default().with_max_message_size(65536));
assert_eq!(65536, a.max_message_size, "should match");

let ppi = PayloadProtocolIdentifier::Unknown;
Expand Down
4 changes: 2 additions & 2 deletions sdp/src/description/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ impl SessionDescription {
}

/// Attribute returns the value of an attribute and if it exists
pub fn attribute(&self, key: &str) -> Option<&String> {
pub fn attribute(&self, key: &str) -> Option<&str> {
for a in &self.attributes {
if a.key == key {
return a.value.as_ref();
return a.value.as_ref().map(|x| x.as_str());
}
}
None
Expand Down

0 comments on commit 5260d38

Please sign in to comment.