Skip to content

Commit

Permalink
core: Fix sync build (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
antangelo authored Nov 13, 2024
1 parent 98dc59e commit 1cc850b
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 22 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/nostd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
schedule:
- cron: '0 0 * * *'
name: Build (no_std)
name: Build (Features)

jobs:
build_lib_no_std:
Expand Down Expand Up @@ -43,3 +43,29 @@ jobs:
command: test
args: -p xdvdfs --no-default-features --features=read

build_lib_sync:
name: Build (xdvdfs-sync)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy

- name: Check lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: -p xdvdfs --features=sync -- -D warnings

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs --features=sync
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resolver = "2"

[workspace.package]
license = "MIT"
version = "0.8.2"
version = "0.8.3"
edition = "2021"
repository = "https://github.com/antangelo/xdvdfs"
homepage = "https://github.com/antangelo/xdvdfs"
Expand Down
2 changes: 1 addition & 1 deletion xdvdfs-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ homepage.workspace = true
exclude = ["**/*.iso", "**/*.xiso"]

[dependencies]
xdvdfs = { path = "../xdvdfs-core", version = "0.8.2" }
xdvdfs = { path = "../xdvdfs-core", version = "0.8.3" }
clap = { version = "4.2.1", features = ["derive"] }
md-5 = { version = "0.10.5", default-features = false }
futures = "0.3.28"
Expand Down
4 changes: 1 addition & 3 deletions xdvdfs-core/src/blockdev.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use maybe_async::maybe_async;

#[cfg(not(feature = "sync"))]
use alloc::boxed::Box;
use maybe_async::maybe_async;

const XDVD_OFFSETS: &[u64] = &[
0, // RAW XISO
Expand Down
4 changes: 2 additions & 2 deletions xdvdfs-core/src/write/avl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,13 @@ pub struct AvlNodeRef<'tree, T: Ord> {
tree: &'tree AvlTree<T>,
}

impl<'tree, T: Ord> AvlNodeRef<'tree, T> {
impl<T: Ord> AvlNodeRef<'_, T> {
pub fn backing_index(&self) -> usize {
self.node
}
}

impl<'tree, T: Ord> core::ops::Deref for AvlNodeRef<'tree, T> {
impl<T: Ord> core::ops::Deref for AvlNodeRef<'_, T> {
type Target = T;
fn deref(&self) -> &Self::Target {
&self.tree.tree[self.node].data
Expand Down
4 changes: 1 addition & 3 deletions xdvdfs-core/src/write/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ use std::borrow::ToOwned;
use std::format;
use std::path::{Path, PathBuf};

use alloc::boxed::Box;
use alloc::string::String;
use alloc::vec::Vec;

#[cfg(not(feature = "sync"))]
use alloc::boxed::Box;

use crate::blockdev::BlockDeviceWrite;

use maybe_async::maybe_async;
Expand Down
1 change: 1 addition & 0 deletions xdvdfs-core/src/write/fs/remap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ where
Ok(match_indices)
}

#[maybe_async]
pub async fn new(
mut fs: FS,
cfg: RemapOverlayConfig,
Expand Down
5 changes: 2 additions & 3 deletions xdvdfs-core/src/write/fs/sector_linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ impl<E: Send + Sync> BlockDeviceWrite<E> for SectorLinearBlockDevice<E> {
}

#[maybe_async]
impl<'a, E, W, F> Filesystem<SectorLinearBlockDevice<E>, E>
for SectorLinearBlockFilesystem<'a, E, W, F>
impl<E, W, F> Filesystem<SectorLinearBlockDevice<E>, E> for SectorLinearBlockFilesystem<'_, E, W, F>
where
W: BlockDeviceWrite<E>,
F: Filesystem<W, E>,
Expand Down Expand Up @@ -196,7 +195,7 @@ where

#[cfg(feature = "ciso_support")]
#[maybe_async]
impl<'a, E, W, F> ciso::write::SectorReader<E> for CisoSectorInput<'a, E, W, F>
impl<E, W, F> ciso::write::SectorReader<E> for CisoSectorInput<'_, E, W, F>
where
W: BlockDeviceWrite<E>,
F: Filesystem<W, E>,
Expand Down
4 changes: 3 additions & 1 deletion xdvdfs-core/src/write/fs/stdfs.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use alloc::borrow::ToOwned;
use alloc::boxed::Box;
use alloc::format;
use alloc::string::String;
use alloc::vec::Vec;
use maybe_async::maybe_async;
use std::path::{Path, PathBuf};

#[cfg(not(feature = "sync"))]
use alloc::boxed::Box;

use crate::blockdev::BlockDeviceWrite;

use super::{FileEntry, FileType, Filesystem, PathVec};
Expand Down
4 changes: 3 additions & 1 deletion xdvdfs-core/src/write/fs/xdvdfs.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use alloc::boxed::Box;
use alloc::vec::Vec;
use core::fmt::Debug;
use core::fmt::Display;

#[cfg(not(feature = "sync"))]
use alloc::boxed::Box;

use maybe_async::maybe_async;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion xdvdfs-desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tauri-build = { version = "1.5.0", features = [] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.5.3", features = [ "api-all"] }
xdvdfs = { path = "../xdvdfs-core", version = "0.8.2" }
xdvdfs = { path = "../xdvdfs-core", version = "0.8.3" }
ciso = { version = "0.2.0", default-features = false }
maybe-async = "0.2.7"
async-trait = "0.1.75"
Expand Down
2 changes: 1 addition & 1 deletion xdvdfs-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ wasm-bindgen = "0.2.84"
wasm-bindgen-futures = "0.4.34"
wasm-logger = "0.2.0"
web-sys = { version = "0.3.61", features = ["WritableStream", "MediaQueryList", "Window"] }
xdvdfs = { path = "../xdvdfs-core", version = "0.8.2" }
xdvdfs = { path = "../xdvdfs-core", version = "0.8.3" }
yew = { version = "0.20.0", features = ["csr"] }
yewprint = "0.4.4"

0 comments on commit 1cc850b

Please sign in to comment.