Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nicholas Bailey
rust-gitlab
Commits
f1e62019
Commit
f1e62019
authored
Sep 02, 2016
by
Ben Boeckel
⛰
Browse files
hooks: fix indentation
parent
605962d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hooks.rs
View file @
f1e62019
...
...
@@ -29,14 +29,14 @@ impl Deserialize for GitlabHook {
// Look for `object_kind` first because some web hooks also have `event_name` which would
// cause a false match here.
let
hook_res
=
if
let
Some
(
_
)
=
val
.pointer
(
"/object_kind"
)
{
from_value
(
val
)
.map
(
GitlabHook
::
Web
)
}
else
if
let
Some
(
_
)
=
val
.pointer
(
"/event_name"
)
{
from_value
(
val
)
.map
(
GitlabHook
::
System
)
}
else
{
return
Err
(
D
::
Error
::
missing_field
(
"either object_kind or event_name"
));
};
from_value
(
val
)
.map
(
GitlabHook
::
Web
)
}
else
if
let
Some
(
_
)
=
val
.pointer
(
"/event_name"
)
{
from_value
(
val
)
.map
(
GitlabHook
::
System
)
}
else
{
return
Err
(
D
::
Error
::
missing_field
(
"either object_kind or event_name"
));
};
hook_res
.map_err
(|
err
|
{
D
::
Error
::
invalid_value
(
&
format!
(
"{:?}"
,
err
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment