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

hooks: apply rustfmt suggestions

parent 7146e11a
......@@ -279,39 +279,21 @@ impl Deserialize for SystemHook {
"project_create" |
"project_destroy" |
"project_rename" |
"project_transfer" => {
from_value(val).map(SystemHook::Project)
},
"project_transfer" => from_value(val).map(SystemHook::Project),
"user_add_to_team" |
"user_remove_from_team" => {
from_value(val).map(SystemHook::ProjectMember)
},
"user_remove_from_team" => from_value(val).map(SystemHook::ProjectMember),
"user_create" |
"user_destroy" => {
from_value(val).map(SystemHook::User)
},
"user_create" | "user_destroy" => from_value(val).map(SystemHook::User),
"key_create" |
"key_destroy" => {
from_value(val).map(SystemHook::Key)
},
"key_create" | "key_destroy" => from_value(val).map(SystemHook::Key),
"group_create" |
"group_destroy" => {
from_value(val).map(SystemHook::Group)
},
"group_create" | "group_destroy" => from_value(val).map(SystemHook::Group),
"user_add_to_group" |
"user_remove_from_group" => {
from_value(val).map(SystemHook::GroupMember)
},
"user_remove_from_group" => from_value(val).map(SystemHook::GroupMember),
"push" |
"tag_push" => {
from_value(val).map(SystemHook::Push)
},
"push" | "tag_push" => from_value(val).map(SystemHook::Push),
_ => {
return Err(D::Error::invalid_value(&format!("unrecognized system event name: {}",
......
......@@ -546,26 +546,15 @@ impl Deserialize for WebHook {
.to_string();
let hook_res = match object_kind.as_str() {
"push" |
"tag_push" => {
from_value(val).map(WebHook::Push)
},
"push" | "tag_push" => from_value(val).map(WebHook::Push),
"issue" => {
from_value(val).map(WebHook::Issue)
},
"issue" => from_value(val).map(WebHook::Issue),
"merge_request" => {
from_value(val).map(WebHook::MergeRequest)
},
"merge_request" => from_value(val).map(WebHook::MergeRequest),
"note" => {
from_value(val).map(WebHook::Note)
},
"note" => from_value(val).map(WebHook::Note),
"build" => {
from_value(val).map(WebHook::Build)
},
"build" => from_value(val).map(WebHook::Build),
_ => {
return Err(D::Error::invalid_value(&format!("unrecognized webhook object kind: {}",
......
Supports Markdown
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