Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ members = [
"bmap-parser",
"bmap-rs",
]
resolver = "3"

# Most of the actual work is CPU-heavy, in particular the rust sha2
# implementation so use full optimisations otherwise everything will run quite
# slow
[profile.dev]
opt-level = 3

[workspace.package]
rust-version = "1.85"
3 changes: 2 additions & 1 deletion bmap-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
name = "bmap-parser"
version = "0.2.0"
authors = ["Sjoerd Simons <[email protected]>"]
edition = "2018"
edition = "2024"
license = "MIT AND Apache-2.0"
description = "bmap-parser is a library for Rust that allows you to copy files or flash block devices safely"
repository = "https://github.com/collabora/bmap-rs"
readme = "../README.md"
rust-version.workspace = true

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

Expand Down
2 changes: 1 addition & 1 deletion bmap-parser/src/bmap/xml.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::bmap::{BmapBuilder, BmapBuilderError, HashType, HashValue};
use quick_xml::de::{from_str, DeError};
use quick_xml::de::{DeError, from_str};
use serde::Deserialize;
use std::str::FromStr;
use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion bmap-parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pub use crate::bmap::*;
mod discarder;
pub use crate::discarder::*;
use async_trait::async_trait;
use futures::io::{AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt, AsyncWrite, AsyncWriteExt};
use futures::TryFutureExt;
use futures::io::{AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt, AsyncWrite, AsyncWriteExt};
use sha2::{Digest, Sha256};
use thiserror::Error;

Expand Down
3 changes: 2 additions & 1 deletion bmap-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
name = "bmap-rs"
version = "0.2.0"
authors = ["Sjoerd Simons <[email protected]>"]
edition = "2018"
edition = "2024"
license = "MIT AND Apache-2.0"
description = "bmap-rs is an application that handles the use of bmap crate"
repository = "https://github.com/collabora/bmap-rs"
readme = "../README.md"
rust-version.workspace = true

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

Expand Down
8 changes: 4 additions & 4 deletions bmap-rs/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::{anyhow, bail, ensure, Context, Result};
use anyhow::{Context, Result, anyhow, bail, ensure};
use async_compression::futures::bufread::GzipDecoder;
use bmap_parser::{AsyncDiscarder, Bmap, Discarder, SeekForward};
use clap::{arg, command, Arg, ArgAction, Command};
use clap::{Arg, ArgAction, Command, arg, command};
use flate2::read::GzDecoder;
use futures::TryStreamExt;
use indicatif::{ProgressBar, ProgressState, ProgressStyle};
Expand Down Expand Up @@ -241,7 +241,7 @@ async fn copy_remote_input(source: Url, destination: PathBuf) -> Result<()> {
let res = setup_remote_input(source).await?;
let stream = res
.bytes_stream()
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
.map_err(std::io::Error::other)
.into_async_read();
let reader = GzipDecoder::new(stream);
let mut input = AsyncDiscarder::new(reader);
Expand Down Expand Up @@ -291,7 +291,7 @@ async fn copy_remote_input_nobmap(source: Url, destination: PathBuf) -> Result<(
let res = setup_remote_input(source).await?;
let stream = res
.bytes_stream()
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
.map_err(std::io::Error::other)
.into_async_read();
let reader = GzipDecoder::new(stream);
let mut input = AsyncDiscarder::new(reader);
Expand Down