Skip to content

Commit 9bb55c1

Browse files
committed
use and return cleanup
1 parent 6711c9a commit 9bb55c1

3 files changed

Lines changed: 24 additions & 20 deletions

File tree

src/concourse.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use serde::{Deserialize, Serialize};
55

66
use concourse_resource::IntoMetadataKV;
7+
use octocrab;
78

89
// standard concourse structs
910
// check input and (vec seralized to list) output, out output
@@ -45,43 +46,42 @@ pub(super) struct Source {
4546
impl Source {
4647
/// Readers
4748
pub(super) fn pat(&self) -> Option<&str> {
48-
return self.pat.as_deref();
49+
self.pat.as_deref()
4950
}
5051
pub(super) fn owner(&self) -> &str {
51-
return &self.owner;
52+
&self.owner
5253
}
5354
pub(super) fn repo(&self) -> &str {
54-
return &self.repo;
55+
&self.repo
5556
}
5657
pub(super) fn number(&self) -> Option<u64> {
57-
return self.number;
58+
self.number
5859
}
5960
pub(super) fn state(&self) -> Option<&str> {
60-
return self.state.as_deref();
61+
self.state.as_deref()
6162
}
6263
pub(super) fn milestone(&self) -> Option<u64> {
63-
return self.milestone;
64+
self.milestone
6465
}
6566
pub(super) fn assignee(&self) -> Option<Vec<String>> {
6667
// convert assignee to single element string vector for compatibility with github issue constructor
67-
return match self.assignee.clone() {
68+
match self.assignee.clone() {
6869
Some(assignee) => Some(vec![assignee]),
6970
None => None,
70-
};
71+
}
7172
}
7273
pub(super) fn labels(&self) -> Option<Vec<String>> {
73-
return self.labels.clone();
74+
self.labels.clone()
7475
}
7576
// return unwrapped value with default false for ease of use
7677
pub(super) fn skip_check(&self) -> bool {
77-
return self.skip_check.unwrap_or(false);
78+
self.skip_check.unwrap_or(false)
7879
}
7980
// return unwrapped value with default closed for ease of use
8081
pub(super) fn trigger(&self) -> octocrab::models::IssueState {
81-
return self
82-
.trigger
82+
self.trigger
8383
.clone()
84-
.unwrap_or(octocrab::models::IssueState::Closed);
84+
.unwrap_or(octocrab::models::IssueState::Closed)
8585
}
8686
}
8787

@@ -101,22 +101,22 @@ pub(super) struct OutParams {
101101
impl OutParams {
102102
/// Readers
103103
pub(super) fn title(&self) -> Option<&str> {
104-
return self.title.as_deref();
104+
self.title.as_deref()
105105
}
106106
pub(super) fn body(&self) -> Option<&str> {
107-
return self.body.as_deref();
107+
self.body.as_deref()
108108
}
109109
pub(super) fn labels(&self) -> Option<Vec<String>> {
110-
return self.labels.clone();
110+
self.labels.clone()
111111
}
112112
pub(super) fn assignees(&self) -> Option<Vec<String>> {
113-
return self.assignees.clone();
113+
self.assignees.clone()
114114
}
115115
pub(super) fn milestone(&self) -> Option<u64> {
116-
return self.milestone;
116+
self.milestone
117117
}
118118
pub(super) fn state(&self) -> Option<&str> {
119-
return self.state.as_deref();
119+
self.state.as_deref()
120120
}
121121
}
122122

src/github_issue.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//! `github_issue` is a minimal utility to create and update issues within Github.
44
use log;
55

6+
use octocrab;
7+
68
// allowed operations for github issue interactions
79
#[non_exhaustive]
810
#[derive(Copy, Clone)]

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use concourse_resource::*;
21
use env_logger;
32
use log;
43

4+
use concourse_resource::*;
5+
use octocrab;
6+
57
mod concourse;
68
mod github_issue;
79

0 commit comments

Comments
 (0)