Skip to content

Commit

Permalink
g3-ip-locate: fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b committed May 9, 2024
1 parent 2ca9874 commit b542269
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/g3-ip-locate/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ impl Request {
Ok(request)
}

pub fn encode_new(ip: IpAddr) -> Result<Vec<u8>, ()> {
pub fn encode_new(ip: IpAddr) -> anyhow::Result<Vec<u8>> {
let ip = ip.to_string();
let value = ValueRef::String(ip.as_str().into());

let mut buf = Vec::with_capacity(320);
rmpv::encode::write_value_ref(&mut buf, &value).map_err(|_| ())?;
rmpv::encode::write_value_ref(&mut buf, &value)?;
Ok(buf)
}
}

0 comments on commit b542269

Please sign in to comment.