Commit c44179a3 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

clippy: avoid using Option::map for unit function calls

parent 74a8daf7
...@@ -686,10 +686,18 @@ impl Gitlab { ...@@ -686,10 +686,18 @@ impl Gitlab {
let mut params = vec![("state", state.as_str())]; let mut params = vec![("state", state.as_str())];
info.refname.map(|v| params.push(("ref", v))); if let Some(v) = info.refname {
info.name.map(|v| params.push(("name", v))); params.push(("ref", v))
info.target_url.map(|v| params.push(("target_url", v))); }
info.description.map(|v| params.push(("description", v))); if let Some(v) = info.name {
params.push(("name", v))
}
if let Some(v) = info.target_url {
params.push(("target_url", v))
}
if let Some(v) = info.description {
params.push(("description", v))
}
self.post_with_param(&path, &params) self.post_with_param(&path, &params)
} }
...@@ -714,10 +722,18 @@ impl Gitlab { ...@@ -714,10 +722,18 @@ impl Gitlab {
let mut params = vec![("state", state.as_str())]; let mut params = vec![("state", state.as_str())];
info.refname.map(|v| params.push(("ref", v))); if let Some(v) = info.refname {
info.name.map(|v| params.push(("name", v))); params.push(("ref", v))
info.target_url.map(|v| params.push(("target_url", v))); }
info.description.map(|v| params.push(("description", v))); if let Some(v) = info.name {
params.push(("name", v))
}
if let Some(v) = info.target_url {
params.push(("target_url", v))
}
if let Some(v) = info.description {
params.push(("description", v))
}
self.post_with_param(&path, &params) self.post_with_param(&path, &params)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment