Skip to content

Commit 3cfac4e

Browse files
Upgrade Rust to 1.85, 2024 edition (#1410)
1 parent 0aab9ed commit 3cfac4e

File tree

24 files changed

+57
-77
lines changed

24 files changed

+57
-77
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1.8@sha256:d6d396f3780b1dd56a3acbc975f57bd2fc501989b50164c41387c42d04e780d0
22

3-
ARG ALPINE_VERSION=3.20
3+
ARG ALPINE_VERSION=3.21
44
ARG ARCH=x86_64
55

66
FROM alpine:${ALPINE_VERSION} AS rust-base
@@ -17,7 +17,7 @@ ARG ARCH
1717
ARG RUSTUP_VERSION=1.27.1
1818

1919
# Update check: https://github.com/rust-lang/rust/tags
20-
ARG RUST_VERSION=1.83.0
20+
ARG RUST_VERSION=1.85.0
2121
ARG RUST_ARCH=${ARCH}-unknown-linux-musl
2222

2323
# https://github.com/sfackler/rust-openssl/issues/1462
@@ -34,7 +34,7 @@ RUN /tmp/rustup-init \
3434
FROM rust-base AS dev-planner
3535

3636
# Update check: https://github.com/LukeMathWalker/cargo-chef/releases
37-
RUN cargo install --version 0.1.67 cargo-chef
37+
RUN cargo install --version 0.1.71 cargo-chef
3838

3939
WORKDIR /usr/src/josh
4040
COPY . .
@@ -51,7 +51,7 @@ RUN apk add --no-cache \
5151

5252
WORKDIR /usr/src/josh
5353
RUN rustup component add rustfmt
54-
RUN cargo install --version 0.1.67 cargo-chef
54+
RUN cargo install --version 0.1.71 cargo-chef
5555
RUN cargo install --verbose --version 0.10.0 graphql_client_cli
5656

5757
RUN apk add --no-cache \

hyper_cgi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "hyper_cgi"
33
version = "22.10.25"
44
authors = ["Christian Schilling <[email protected]>", "Louis-Marie Givel <[email protected]>"]
5-
edition = "2021"
5+
edition = "2024"
66
license-file = "LICENSE"
77
description = "Run CGI scripts with hyper"
88
repository = "https://github.com/josh-project/josh"

hyper_cgi/src/bin/hyper-cgi-test-server.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
extern crate lazy_static;
33
use core::iter;
44
use core::str::from_utf8;
5-
use rand::{distributions::Alphanumeric, thread_rng, Rng};
5+
use rand::{Rng, distributions::Alphanumeric, thread_rng};
66
use std::str::FromStr;
77

88
use futures::FutureExt;
@@ -11,28 +11,20 @@ use hyper::server::Server;
1111

1212
// Import the base64 crate Engine trait anonymously so we can
1313
// call its methods without adding to the namespace.
14-
use base64::engine::general_purpose::STANDARD as BASE64;
1514
use base64::engine::Engine as _;
15+
use base64::engine::general_purpose::STANDARD as BASE64;
1616

1717
#[macro_export]
1818
macro_rules! some_or {
1919
($e:expr, $b:block) => {
20-
if let Some(x) = $e {
21-
x
22-
} else {
23-
$b
24-
}
20+
if let Some(x) = $e { x } else { $b }
2521
};
2622
}
2723

2824
#[macro_export]
2925
macro_rules! ok_or {
3026
($e:expr, $b:block) => {
31-
if let Ok(x) = $e {
32-
x
33-
} else {
34-
$b
35-
}
27+
if let Ok(x) = $e { x } else { $b }
3628
};
3729
}
3830

hyper_cgi/src/hyper_cgi.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This module implements a do_cgi function, to run CGI scripts with hyper
2-
use futures::stream::StreamExt;
32
use futures::TryStreamExt;
3+
use futures::stream::StreamExt;
44
use hyper::{Request, Response};
55
use std::process::Stdio;
66
use std::str::FromStr;
@@ -25,7 +25,7 @@ pub async fn do_cgi(
2525
return (
2626
error_response(),
2727
std::vec::Vec::from("Unable to spawn child command"),
28-
)
28+
);
2929
}
3030
};
3131
let stdin = match child.stdin.take() {
@@ -34,7 +34,7 @@ pub async fn do_cgi(
3434
return (
3535
error_response(),
3636
std::vec::Vec::from("Unable to open stdin"),
37-
)
37+
);
3838
}
3939
};
4040
let stdout = match child.stdout.take() {
@@ -43,7 +43,7 @@ pub async fn do_cgi(
4343
return (
4444
error_response(),
4545
std::vec::Vec::from("Unable to open stdout"),
46-
)
46+
);
4747
}
4848
};
4949
let stderr = match child.stderr.take() {
@@ -52,7 +52,7 @@ pub async fn do_cgi(
5252
return (
5353
error_response(),
5454
std::vec::Vec::from("Unable to open stderr"),
55-
)
55+
);
5656
}
5757
};
5858

josh-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license-file = "LICENSE"
77
description = "GIT virtualization proxy"
88
keywords = ["git", "monorepo", "workflow", "scm"]
99
readme = "README.md"
10-
edition = "2021"
10+
edition = "2024"
1111

1212
[dependencies]
1313
backtrace = "0.3.74"

josh-core/src/filter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ fn apply_to_commit2(
653653
},
654654
true,
655655
))
656-
.transpose()
656+
.transpose();
657657
}
658658
Op::Join(refs) => {
659659
// First loop to populate missing list

josh-core/src/history.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ pub fn unapply_filter(
491491
commit_message,
492492
module_commit.id(),
493493
msg
494-
)))
494+
)));
495495
}
496496
};
497497

@@ -627,7 +627,7 @@ pub fn unapply_filter(
627627
{
628628
original_parents[0].id()
629629
} else {
630-
if let Some(ref mut change_ids) = change_ids {
630+
if let Some(change_ids) = change_ids {
631631
change_ids.push(get_change_id(&module_commit, ret));
632632
}
633633
ret

josh-core/src/housekeeping.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::*;
22
use itertools::Itertools;
33
use std::collections::{BTreeSet, HashMap};
44
use std::path::Path;
5-
use tracing::{info, span, Level};
5+
use tracing::{Level, info, span};
66

77
pub type KnownViews = HashMap<String, (git2::Oid, BTreeSet<String>)>;
88

josh-core/src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,14 @@
33
#[macro_export]
44
macro_rules! some_or {
55
($e:expr, $b:block) => {
6-
if let Some(x) = $e {
7-
x
8-
} else {
9-
$b
10-
}
6+
if let Some(x) = $e { x } else { $b }
117
};
128
}
139

1410
#[macro_export]
1511
macro_rules! ok_or {
1612
($e:expr, $b:block) => {
17-
if let Ok(x) = $e {
18-
x
19-
} else {
20-
$b
21-
}
13+
if let Ok(x) = $e { x } else { $b }
2214
};
2315
}
2416

josh-filter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Christian Schilling <[email protected]>"]
33
description = "GIT filter cli"
4-
edition = "2021"
4+
edition = "2024"
55
keywords = ["git", "monorepo", "workflow", "scm"]
66
license-file = "LICENSE"
77
name = "josh-filter"

josh-graphql/Cargo.toml

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

66
[dependencies]
77
josh = { path = "../josh-core" }

josh-graphql/src/graphql.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(unused_variables)]
22

3-
use josh::{cache, filter, history, josh_error, JoshResult};
4-
use juniper::{graphql_object, EmptyMutation, EmptySubscription, FieldResult};
3+
use josh::{JoshResult, cache, filter, history, josh_error};
4+
use juniper::{EmptyMutation, EmptySubscription, FieldResult, graphql_object};
55

66
pub struct Revision {
77
filter: filter::Filter,

josh-proxy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["Christian Schilling <[email protected]>"]
33
description = "GIT virtualization proxy"
4-
edition = "2021"
4+
edition = "2024"
55
keywords = ["git", "monorepo", "workflow", "scm"]
66
license-file = "LICENSE"
77
name = "josh-proxy"

josh-proxy/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use std::sync::Arc;
22

33
// Import the base64 crate Engine trait anonymously so we can
44
// call its methods without adding to the namespace.
5-
use base64::engine::general_purpose::STANDARD as BASE64;
65
use base64::engine::Engine as _;
6+
use base64::engine::general_purpose::STANDARD as BASE64;
77
use tracing::Instrument;
88

99
// Auths in those groups are independent of each other.

0 commit comments

Comments
 (0)