Skip to content

Commit

Permalink
resolve clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendon-Hablutzel committed Mar 30, 2024
1 parent 56e327b commit 562beb2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ const DESCRIPTION_ENDPOINT: &str = "/xml/device_description.xml";
/// Returns basic information about a speaker, if one is found at the given IP address
/// * `ip_addr` - the IP of the speaker to query for information
pub async fn get_speaker_info(ip_addr: Ipv4Addr) -> Result<BasicSpeakerInfo, SpeakerError> {
let url = format!(
"http://{}:1400{}",
ip_addr.to_string(),
DESCRIPTION_ENDPOINT
);
let url = format!("http://{}:1400{}", ip_addr, DESCRIPTION_ENDPOINT);

let response = reqwest::get(&url).await?;

Expand Down
6 changes: 1 addition & 5 deletions src/speaker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ impl PartialEq for BasicSpeakerInfo {
fn eq(&self, other: &Self) -> bool {
self.ip_addr == other.ip_addr
}

fn ne(&self, other: &Self) -> bool {
!self.eq(other)
}
}

/// A sonos speaker
Expand Down Expand Up @@ -101,7 +97,7 @@ impl Speaker {
) -> Result<String, SpeakerError> {
let url = format!("http://{}:1400{}", self.ip_addr, service.get_endpoint());

let xml_body = generate_xml(&action_name, &service, arguments)?;
let xml_body = generate_xml(action_name, &service, arguments)?;

let response = self
.client
Expand Down
2 changes: 1 addition & 1 deletion src/xml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub(crate) fn get_tag_by_name_node<'a>(
Ok(tag)
}

pub(crate) fn get_text<'a>(node: roxmltree::Node<'a, '_>) -> Result<String, XMLError> {
pub(crate) fn get_text(node: roxmltree::Node<'_, '_>) -> Result<String, XMLError> {
node.text()
.ok_or(XMLError::ElementNotFound(
node.tag_name().name().to_string(),
Expand Down

0 comments on commit 562beb2

Please sign in to comment.