Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dheijl committed Sep 30, 2024
1 parent 2e5eaf6 commit bb245b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/openhome/rendercontrol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pub struct SupportedProtocols: u32 {
}

/// Renderer struct describers a media renderer,
/// info is collected from GetDescription.xml
/// info is collected from the GetDescription.xml
#[derive(Debug, Clone)]
pub struct Renderer {
pub dev_name: String,
Expand Down Expand Up @@ -903,7 +903,7 @@ fn get_service_description(dev_url: &str) -> Option<String> {
}
}

/// build a renderer struct by parsing the GetDescription.xml
/// build a renderer struct by (roughly) parsing the GetDescription.xml
fn get_renderer(xml: &str) -> Option<Renderer> {
let xmlstream = StringReader::new(xml);
let parser = EventReader::new(xmlstream);
Expand Down Expand Up @@ -948,6 +948,7 @@ fn get_renderer(xml: &str) -> Option<Renderer> {
}
}
Ok(XmlEvent::Characters(value)) => match cur_elem {
// these values come from various tags, ignoring xml hierarchy
ref el if el.contains("serviceType") => service.service_type = value,
ref el if el.contains("serviceId") => service.service_id = value,
ref el if el.contains("modelName") => renderer.dev_model = value,
Expand Down

0 comments on commit bb245b0

Please sign in to comment.