Skip to content

Commit 7da8e90

Browse files
committed
rustc, cargo, edition, and ci updates
1 parent 2bebedd commit 7da8e90

File tree

4 files changed

+43
-19
lines changed

4 files changed

+43
-19
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
test:
66
working_directory: /tmp/project
77
docker:
8-
- image: cimg/rust:1.85
8+
- image: cimg/rust:1.86
99
resource_class: small
1010
steps:
1111
- checkout

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "concourse-github-issue"
33
version = "1.2.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
octocrab = "0.44"

src/github_issue.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ fn str_to_issue_state(param: &str) -> Result<octocrab::models::IssueState, &str>
3232
"open" => Ok(octocrab::models::IssueState::Open),
3333
"closed" => Ok(octocrab::models::IssueState::Closed),
3434
"all" => {
35-
log::warn!("all was specified for issue state, and this can only be utilized with issue filtering, and not updating");
35+
log::warn!(
36+
"all was specified for issue state, and this can only be utilized with issue filtering, and not updating"
37+
);
3638
log::warn!("the issue state will be reset to 'open'");
3739
Ok(octocrab::models::IssueState::Open)
3840
}
@@ -242,7 +244,9 @@ impl<'issue> Issue<'issue> {
242244
let num_assignees = self.assignees.as_ref().unwrap().len();
243245
if num_assignees != 1 {
244246
log::error!("list action attempted with other than one assignee: {num_assignees}");
245-
log::error!("this is an error with custom resource frontend and backend interfacing, and should be reported");
247+
log::error!(
248+
"this is an error with custom resource frontend and backend interfacing, and should be reported"
249+
);
246250
return Err("multiple assignees and list action");
247251
}
248252
// assign value of only assignee and use for assignee filter

src/main.rs

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@ impl concourse_resource::Resource for GithubIssue {
7373

7474
// return one sized version vector if issue is open and two sized if closed
7575
match issue.state {
76-
octocrab::models::IssueState::Open => vec![concourse::Version::new(String::from("open"))],
77-
octocrab::models::IssueState::Closed => vec![concourse::Version::new(String::from("open")), concourse::Version::new(String::from("closed"))],
78-
_ => panic!("expected the github issue state to either be open or closed, and somehow it is something else")
76+
octocrab::models::IssueState::Open => {
77+
vec![concourse::Version::new(String::from("open"))]
78+
}
79+
octocrab::models::IssueState::Closed => vec![
80+
concourse::Version::new(String::from("open")),
81+
concourse::Version::new(String::from("closed")),
82+
],
83+
_ => panic!(
84+
"expected the github issue state to either be open or closed, and somehow it is something else"
85+
),
7986
}
8087
}
8188

@@ -93,8 +100,12 @@ impl concourse_resource::Resource for GithubIssue {
93100
// init logger
94101
_ = env_logger::try_init();
95102

96-
log::info!("reminder: the in step is only to be used for an efficient check step with minimal overhead");
97-
log::info!("there is no actual functionality for the in step, and the version and metadata are dummied");
103+
log::info!(
104+
"reminder: the in step is only to be used for an efficient check step with minimal overhead"
105+
);
106+
log::info!(
107+
"there is no actual functionality for the in step, and the version and metadata are dummied"
108+
);
98109
Ok(concourse_resource::InOutput {
99110
version: concourse::Version::new(String::from("open")),
100111
metadata: None,
@@ -212,10 +223,13 @@ mod tests {
212223
let version_vec = GithubIssue::resource_check(Some(source), Some(version));
213224
// the issue is closed so we expect a size two vec
214225
assert_eq!(
215-
version_vec,
216-
vec![concourse::Version::new(String::from("open")), concourse::Version::new(String::from("closed"))],
217-
"the resource_check did not return a two size vector of issue states for a closed issue",
218-
);
226+
version_vec,
227+
vec![
228+
concourse::Version::new(String::from("open")),
229+
concourse::Version::new(String::from("closed"))
230+
],
231+
"the resource_check did not return a two size vector of issue states for a closed issue",
232+
);
219233
}
220234

221235
#[test]
@@ -248,8 +262,11 @@ mod tests {
248262
// the issue is open so we expect a size one vec
249263
assert_eq!(
250264
version_vec,
251-
vec![concourse::Version::new(String::from("open")), concourse::Version::new(String::from("closed"))],
252-
"the resource_check did not return a one size vector of issue states for a closed issue",
265+
vec![
266+
concourse::Version::new(String::from("open")),
267+
concourse::Version::new(String::from("closed"))
268+
],
269+
"the resource_check did not return a one size vector of issue states for a closed issue",
253270
);
254271
}
255272

@@ -280,10 +297,13 @@ mod tests {
280297
let version_vec = GithubIssue::resource_check(Some(source), Some(version));
281298
// skip check step requested so we expect size two vec
282299
assert_eq!(
283-
version_vec,
284-
vec![concourse::Version::new(String::from("open")), concourse::Version::new(String::from("closed"))],
285-
"the resource_check did not return a two size vector of issue states for a requested check skip",
286-
);
300+
version_vec,
301+
vec![
302+
concourse::Version::new(String::from("open")),
303+
concourse::Version::new(String::from("closed"))
304+
],
305+
"the resource_check did not return a two size vector of issue states for a requested check skip",
306+
);
287307
}
288308

289309
#[test]

0 commit comments

Comments
 (0)