diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b73add5a34a96c2a176a119b9d18ce9831587aa..70a75e6a1a324ce77a0348697803d7d22afa3ec5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ stages: - test .rust_minimum: - image: "rust:1.81" + image: "rust:1.82" variables: CARGO_UPDATE_POLICY: newest diff --git a/ghostflow-github/src/ghostflow.rs b/ghostflow-github/src/ghostflow.rs index 8a8015512470be9f2300dd3c546608a0a8c6cd76..7b81d982ddc1f73aaec9905444dfecabcddea31f 100644 --- a/ghostflow-github/src/ghostflow.rs +++ b/ghostflow-github/src/ghostflow.rs @@ -1395,6 +1395,8 @@ impl Debug for GithubService { #[cfg(test)] mod tests { + use std::iter; + use ghostflow::host::User; use crate::authorization::CurrentUser; @@ -1446,9 +1448,13 @@ mod tests { trim_to_check_run_limit, GITHUB_CHECK_RUN_MESSAGE_LIMIT, GITHUB_OVERFLOW_INDICATOR, }; - let just_short_enough = format!("{:width$}", 0, width = GITHUB_CHECK_RUN_MESSAGE_LIMIT); + let just_short_enough: String = iter::repeat_n(' ', GITHUB_CHECK_RUN_MESSAGE_LIMIT - 1) + .chain(iter::once('0')) + .collect(); assert_eq!(just_short_enough.len(), GITHUB_CHECK_RUN_MESSAGE_LIMIT); - let long_text = format!("{:width$}", 0, width = GITHUB_CHECK_RUN_MESSAGE_LIMIT + 1); + let long_text: String = iter::repeat_n(' ', GITHUB_CHECK_RUN_MESSAGE_LIMIT) + .chain(iter::once('0')) + .collect(); assert!(long_text.len() > GITHUB_CHECK_RUN_MESSAGE_LIMIT); let long_text_trimmed = format!( "{}{:width$}",