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
VC
rust-gitlab
Commits
46e4cca4
Commit
46e4cca4
authored
Jan 30, 2017
by
Ben Boeckel
Browse files
rustfmt: apply sensible suggestions
parent
41a0fe6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/gitlab.rs
View file @
46e4cca4
...
...
@@ -185,8 +185,7 @@ impl Gitlab {
}
/// Add a project hook.
pub
fn
add_hook
(
&
self
,
project
:
ProjectId
,
url
:
&
str
,
events
:
WebhookEvents
)
->
Result
<
Hook
>
{
pub
fn
add_hook
(
&
self
,
project
:
ProjectId
,
url
:
&
str
,
events
:
WebhookEvents
)
->
Result
<
Hook
>
{
let
mut
flags
=
Self
::
event_flags
(
events
);
flags
.push
((
"url"
,
url
));
...
...
@@ -241,8 +240,7 @@ impl Gitlab {
}
/// Get comments on a commit.
pub
fn
commit_comments
(
&
self
,
project
:
ProjectId
,
commit
:
&
str
)
->
Result
<
Vec
<
CommitNote
>>
{
pub
fn
commit_comments
(
&
self
,
project
:
ProjectId
,
commit
:
&
str
)
->
Result
<
Vec
<
CommitNote
>>
{
self
._get_paged
(
&
format!
(
"projects/{}/repository/commits/{}/comments"
,
project
,
commit
))
...
...
@@ -291,8 +289,7 @@ impl Gitlab {
}
/// Get the latest builds of a commit.
pub
fn
commit_latest_builds
(
&
self
,
project
:
ProjectId
,
commit
:
&
str
)
->
Result
<
Vec
<
Build
>>
{
pub
fn
commit_latest_builds
(
&
self
,
project
:
ProjectId
,
commit
:
&
str
)
->
Result
<
Vec
<
Build
>>
{
self
._get_paged
(
&
format!
(
"projects/{}/repository/commits/{}/builds"
,
project
,
commit
))
}
...
...
src/test/types.rs
View file @
46e4cca4
...
...
@@ -136,7 +136,7 @@ fn test_read_issue() {
assert_eq!
(
assignee
.name
,
"Ben Boeckel"
);
assert_eq!
(
assignee
.state
,
UserState
::
Active
);
assert_eq!
(
assignee
.avatar_url
,
"https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon"
);
"https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon"
);
assert_eq!
(
assignee
.id
,
UserId
::
new
(
13
));
}
else
{
panic!
(
"expected to have an assignee for the issue"
);
...
...
@@ -186,7 +186,7 @@ fn test_read_issue_reference() {
assert_eq!
(
assignee
.name
,
"Ben Boeckel"
);
assert_eq!
(
assignee
.state
,
UserState
::
Active
);
assert_eq!
(
assignee
.avatar_url
,
"https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon"
);
"https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon"
);
assert_eq!
(
assignee
.id
,
UserId
::
new
(
13
));
}
else
{
panic!
(
"expected to have an assignee for the issue"
);
...
...
@@ -497,7 +497,8 @@ fn test_read_user_public() {
assert_eq!
(
user_public
.state
,
UserState
::
Active
);
assert_eq!
(
user_public
.avatar_url
,
"https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon"
);
assert_eq!
(
user_public
.web_url
,
"https://gitlab.kitware.com/ben.boeckel"
);
assert_eq!
(
user_public
.web_url
,
"https://gitlab.kitware.com/ben.boeckel"
);
assert_eq!
(
user_public
.created_at
,
UTC
.ymd
(
2015
,
2
,
26
)
.and_hms_milli
(
17
,
23
,
28
,
730
));
...
...
src/webhooks.rs.in
View file @
46e4cca4
...
...
@@ -17,8 +17,7 @@ extern crate serde_json;
use self::serde_json::Value;
use super::types::{BuildId, IssueId, IssueState, MergeRequestId, MergeRequestState, MergeStatus,
MilestoneId, NoteId, NoteType, NoteableId, ObjectId, ProjectId, SnippetId,
UserId};
MilestoneId, NoteId, NoteType, NoteableId, ObjectId, ProjectId, SnippetId, UserId};
#[derive(Debug, Clone, Copy)]
/// A wrapper struct for dates in web hooks.
...
...
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