From b7b2a63273b8496ddba8facb3db78b510500f263 Mon Sep 17 00:00:00 2001 From: yngrtc Date: Sat, 17 Feb 2024 15:16:10 -0800 Subject: [PATCH] change SDP.attribute to Opton<&str> --- sdp/src/description/session.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdp/src/description/session.rs b/sdp/src/description/session.rs index 52e53b5..3da129e 100644 --- a/sdp/src/description/session.rs +++ b/sdp/src/description/session.rs @@ -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