Skip to content

Commit 6b38683

Browse files
committed
upgrade to 2024 edition
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent f8166e2 commit 6b38683

File tree

9 files changed

+19
-17
lines changed

9 files changed

+19
-17
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
116116
strategy:
117117
matrix:
118-
msrv: ["1.80.0"] # `Lazy` types stabilized in "1.80".
118+
msrv: ["1.85.1"] # 2024 Edition.
119119
name: ubuntu / ${{ matrix.msrv }}
120120
steps:
121121
- uses: actions/checkout@v4

Cargo.toml

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

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

src/bpm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
//! pool manager would work.
1111
1212
use crate::{
13-
page::{Page, PageHandle, PageId, PAGE_SIZE},
14-
storage::{Frame, FrameGroup, StorageManager, FRAME_GROUP_SIZE},
13+
page::{PAGE_SIZE, Page, PageHandle, PageId},
14+
storage::{FRAME_GROUP_SIZE, Frame, FrameGroup, StorageManager},
1515
};
1616
use rand::prelude::*;
1717
use scc::HashMap;
18-
use std::sync::{atomic::AtomicBool, Arc, OnceLock};
18+
use std::sync::{Arc, OnceLock, atomic::AtomicBool};
1919
use std::{future::Future, io::Result};
2020
use tokio::sync::RwLock;
2121
use tokio::task;

src/page/page_handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
//! one of the methods on [`PageHandle`].
77
88
use crate::bpm::BufferPoolManager;
9-
use crate::page::page_guard::{ReadPageGuard, WritePageGuard};
109
use crate::page::Page;
10+
use crate::page::page_guard::{ReadPageGuard, WritePageGuard};
1111
use crate::storage::{Frame, StorageManagerHandle};
1212
use derivative::Derivative;
1313
use std::io::Result;
1414
use std::ops::Deref;
15-
use std::sync::atomic::Ordering;
1615
use std::sync::Arc;
16+
use std::sync::atomic::Ordering;
1717
use tokio::sync::RwLockWriteGuard;
1818
use tracing::field::Empty;
1919
use tracing::{info, instrument, trace, warn};

src/storage/frame.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
//! with the the kernel to avoid unnecessary `memcpy`s from the kernel's internal buffers into
55
//! user-space buffers.
66
7-
use crate::storage::frame_group::{EvictionState, FrameGroup, FRAME_GROUP_SIZE};
7+
use crate::storage::frame_group::{EvictionState, FRAME_GROUP_SIZE, FrameGroup};
88
use crate::{
99
bpm::BufferPoolManager,
10-
page::{Page, PAGE_SIZE},
10+
page::{PAGE_SIZE, Page},
1111
};
1212
use std::{
1313
ops::{Deref, DerefMut},

src/storage/frame_group.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use crate::storage::storage_manager::StorageManager;
1010
use async_channel::{Receiver, Sender};
1111
use std::io::Result;
1212
use std::sync::{
13-
atomic::{AtomicUsize, Ordering},
1413
Arc, Mutex,
14+
atomic::{AtomicUsize, Ordering},
1515
};
1616

1717
/// The number of frames in a [`FrameGroup`].

src/storage/storage_manager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use crate::{page::PageId, storage::frame::Frame};
1313
use std::io::Result;
1414
use std::ops::Deref;
1515
use std::os::unix::fs::OpenOptionsExt;
16-
use std::sync::atomic::{AtomicUsize, Ordering};
1716
use std::sync::LazyLock;
17+
use std::sync::atomic::{AtomicUsize, Ordering};
1818
use std::{rc::Rc, sync::OnceLock};
19-
use tokio_uring::fs::File;
2019
use tokio_uring::BufResult;
20+
use tokio_uring::fs::File;
2121

2222
/// The name of the database's file.
2323
pub const DATABASE_NAME: &str = "bpm.db";

tests/basic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use async_bpm::{page::PageId, BufferPoolManager};
1+
use async_bpm::{BufferPoolManager, page::PageId};
22
use std::ops::DerefMut;
33
use std::thread;
44

tests/throughput.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
use async_bpm::{
2-
page::{PageId, PAGE_SIZE},
32
BufferPoolManager, IO_OPERATIONS,
3+
page::{PAGE_SIZE, PageId},
44
};
55
use core_affinity::CoreId;
66
use rand::rng;
7-
use rand::{distr::Distribution, Rng};
7+
use rand::{Rng, distr::Distribution};
88
use rand_distr::Zipf;
99
use std::{
1010
ops::{Deref, DerefMut},
1111
sync::{
12-
atomic::{AtomicUsize, Ordering},
1312
Arc,
13+
atomic::{AtomicUsize, Ordering},
1414
},
1515
thread,
1616
};
@@ -63,7 +63,9 @@ const READ: bool = true;
6363
fn throughput() {
6464
tracing_subscriber::fmt::init();
6565

66-
info!("Find tasks: {FIND_TASKS}, Find Threads: {FIND_THREADS}, Scan Tasks: {SCAN_TASKS}, Scan Threads: {SCAN_THREADS}");
66+
info!(
67+
"Find tasks: {FIND_TASKS}, Find Threads: {FIND_THREADS}, Scan Tasks: {SCAN_TASKS}, Scan Threads: {SCAN_THREADS}"
68+
);
6769

6870
BufferPoolManager::initialize(FRAMES, STORAGE_PAGES);
6971

0 commit comments

Comments
 (0)