various: fix auto-fisable Clippy lints
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I79a708981b5aee43eadbd48d69fb78be6a6a6964
This commit is contained in:
parent
3a03cf7b3e
commit
0dc09dbd19
2 changed files with 7 additions and 7 deletions
|
|
@ -220,8 +220,8 @@ pub struct DeclarativeProject {
|
||||||
/// Declarative notification configuration.
|
/// Declarative notification configuration.
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct DeclarativeNotification {
|
pub struct DeclarativeNotification {
|
||||||
/// Notification type: github_status, email, gitlab_status, gitea_status,
|
/// Notification type: `github_status`, email, `gitlab_status`, `gitea_status`,
|
||||||
/// run_command
|
/// `run_command`
|
||||||
pub notification_type: String,
|
pub notification_type: String,
|
||||||
/// Type-specific configuration (JSON object)
|
/// Type-specific configuration (JSON object)
|
||||||
pub config: serde_json::Value,
|
pub config: serde_json::Value,
|
||||||
|
|
@ -274,7 +274,7 @@ pub struct DeclarativeJobset {
|
||||||
pub flake_mode: bool,
|
pub flake_mode: bool,
|
||||||
#[serde(default = "default_check_interval")]
|
#[serde(default = "default_check_interval")]
|
||||||
pub check_interval: i32,
|
pub check_interval: i32,
|
||||||
/// Jobset state: disabled, enabled, one_shot, or one_at_a_time
|
/// Jobset state: disabled, enabled, `one_shot`, or `one_at_a_time`
|
||||||
pub state: Option<String>,
|
pub state: Option<String>,
|
||||||
/// Git branch to track (defaults to repository default branch)
|
/// Git branch to track (defaults to repository default branch)
|
||||||
pub branch: Option<String>,
|
pub branch: Option<String>,
|
||||||
|
|
|
||||||
|
|
@ -1035,10 +1035,10 @@ async fn queue_page(State(state): State<AppState>) -> Html<String> {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let tmpl = QueueTemplate {
|
let tmpl = QueueTemplate {
|
||||||
running_builds,
|
|
||||||
pending_builds,
|
pending_builds,
|
||||||
running_count,
|
running_builds,
|
||||||
pending_count,
|
pending_count,
|
||||||
|
running_count,
|
||||||
};
|
};
|
||||||
Html(
|
Html(
|
||||||
tmpl
|
tmpl
|
||||||
|
|
@ -1049,7 +1049,7 @@ async fn queue_page(State(state): State<AppState>) -> Html<String> {
|
||||||
|
|
||||||
fn format_elapsed(secs: i64) -> String {
|
fn format_elapsed(secs: i64) -> String {
|
||||||
if secs < 60 {
|
if secs < 60 {
|
||||||
format!("{}s", secs)
|
format!("{secs}s")
|
||||||
} else if secs < 3600 {
|
} else if secs < 3600 {
|
||||||
format!("{}m {}s", secs / 60, secs % 60)
|
format!("{}m {}s", secs / 60, secs % 60)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1142,7 +1142,7 @@ async fn admin_page(
|
||||||
.map(|b| {
|
.map(|b| {
|
||||||
let current_builds = *builds_per_builder.get(&b.id).unwrap_or(&0);
|
let current_builds = *builds_per_builder.get(&b.id).unwrap_or(&0);
|
||||||
let load_percent = if b.max_jobs > 0 {
|
let load_percent = if b.max_jobs > 0 {
|
||||||
(current_builds * 100) / (b.max_jobs as i64)
|
(current_builds * 100) / i64::from(b.max_jobs)
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue