Skip to content

Commit a4acecc

Browse files
committed
Bump rust edition to 2024
1 parent 231a87e commit a4acecc

25 files changed

Lines changed: 48 additions & 50 deletions

File tree

pixie-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2021"
2+
edition = "2024"
33
name = "pixie-server"
44
version = "0.1.0"
55

pixie-server/src/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
use crate::state::{State, UnitSelector};
44
use anyhow::Result;
55
use axum::{
6+
Router,
67
body::Body,
78
extract::{self, Path},
89
http::{Response, StatusCode},
910
response::IntoResponse,
1011
routing::get,
11-
Router,
1212
};
1313
use futures::StreamExt;
1414
use pixie_shared::{Action, HttpConfig, StatusUpdate};

pixie-server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod tcp;
66
mod udp;
77

88
use crate::state::State;
9-
use anyhow::{bail, ensure, Context, Result};
9+
use anyhow::{Context, Result, bail, ensure};
1010
use clap::Parser;
1111
use interfaces::Interface;
1212
use ipnet::Ipv4Net;

pixie-server/src/state/images.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::state::{atomic_write, State, CHUNKS_DIR, IMAGES_DIR};
2-
use anyhow::{ensure, Context, Result};
1+
use crate::state::{CHUNKS_DIR, IMAGES_DIR, State, atomic_write};
2+
use anyhow::{Context, Result, ensure};
33
use pixie_shared::{ChunkHash, ChunkStats, ChunksStats, Image, ImagesStats, MAX_CHUNK_SIZE};
44
use tokio::sync::watch;
55

pixie-server/src/state/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
mod images;
1414
mod units;
1515

16-
use anyhow::{anyhow, ensure, Context, Result};
16+
use anyhow::{Context, Result, anyhow, ensure};
1717
use pixie_shared::{
1818
ChunkHash, ChunkStats, ChunksStats, Config, Image, ImagesStats, RegistrationInfo, Unit,
1919
};
@@ -24,8 +24,8 @@ use std::{
2424
net::{IpAddr, Ipv4Addr},
2525
path::{Path, PathBuf},
2626
sync::{
27-
atomic::{AtomicU64, Ordering},
2827
Mutex,
28+
atomic::{AtomicU64, Ordering},
2929
},
3030
};
3131
use tokio::sync::watch;

pixie-server/src/state/units.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::state::State;
2-
use anyhow::{bail, ensure, Result};
2+
use anyhow::{Result, bail, ensure};
33
use macaddr::MacAddr6;
44
use pixie_shared::{Action, RegistrationInfo, Unit};
55
use std::net::Ipv4Addr;

pixie-server/src/tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
};
77
use anyhow::{Context, Result};
88
use macaddr::MacAddr6;
9-
use pixie_shared::{TcpRequest, ACTION_PORT};
9+
use pixie_shared::{ACTION_PORT, TcpRequest};
1010
use std::{
1111
io::ErrorKind,
1212
net::{Ipv4Addr, SocketAddr},

pixie-server/src/udp.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use crate::{
44
find_mac,
55
state::{State, UnitSelector},
66
};
7-
use anyhow::{ensure, Context, Result};
7+
use anyhow::{Context, Result, ensure};
88
use futures::FutureExt;
99
use ipnet::Ipv4Net;
1010
use pixie_shared::{
11-
chunk_codec::Encoder, ChunkHash, HintPacket, InterfaceConfig, RegistrationInfo, UdpRequest,
12-
ACTION_PORT, CHUNKS_PORT, HINT_PORT, UDP_BODY_LEN,
11+
ACTION_PORT, CHUNKS_PORT, ChunkHash, HINT_PORT, HintPacket, InterfaceConfig, RegistrationInfo,
12+
UDP_BODY_LEN, UdpRequest, chunk_codec::Encoder,
1313
};
1414
use std::{
1515
collections::BTreeSet,
@@ -123,12 +123,11 @@ fn compute_hint(state: &State) -> Result<RegistrationInfo> {
123123
.map(|unit| (unit.row, unit.col))
124124
.collect::<Vec<_>>();
125125

126-
if last.row == 0 {
127-
if let Some(&(r, c)) = positions.iter().max() {
126+
if last.row == 0
127+
&& let Some(&(r, c)) = positions.iter().max() {
128128
last.row = r;
129129
last.col = c;
130130
}
131-
}
132131

133132
let (mrow, mcol) = positions
134133
.iter()

pixie-shared/Cargo.toml

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

66
[dependencies]
77
blake3 = { version = "1", default-features = false }

pixie-uefi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2021"
2+
edition = "2024"
33
name = "pixie-uefi"
44
version = "0.1.0"
55

0 commit comments

Comments
 (0)