Skip to content

Commit

Permalink
Use edition 2024 for all crates (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 authored Dec 9, 2024
1 parent 9737b83 commit 15823da
Show file tree
Hide file tree
Showing 228 changed files with 506 additions and 533 deletions.
1 change: 1 addition & 0 deletions crates/api-desc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Minor

- Use Rust edition 2024
- Use C-string literals to implement dispatch for native applets
- Implement `bytemuck::Pod` for generated `Params`

Expand Down
2 changes: 1 addition & 1 deletion crates/api-desc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.2.2-git"
authors = ["Julien Cretin <[email protected]>"]
license = "Apache-2.0"
publish = true
edition = "2021"
edition = "2024"
description = "Description of the Wasefire applet API"
repository = "https://github.com/google/wasefire"
include = ["/LICENSE", "/src/"]
Expand Down
2 changes: 1 addition & 1 deletion crates/api-desc/crates/update/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Julien Cretin <[email protected]>"]
license = "Apache-2.0"
publish = false
edition = "2021"
edition = "2024"

[dependencies]
anyhow = { version = "1.0.86", default-features = false, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/api-desc/crates/update/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

use std::fs::File;
use std::io::{stdout, Write};
use std::io::{Write, stdout};

use anyhow::Result;
use clap::{Parser, ValueEnum};
Expand Down
12 changes: 4 additions & 8 deletions crates/api-desc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ impl Fn {
pub struct Params { #(#params,)* }
}
#[cfg(not(feature = "native"))]
extern "C" {
unsafe extern "C" {
#(#[doc = #docs])*
#[link_name = #link]
pub fn #name(#fn_params) -> isize;
pub unsafe fn #name(#fn_params) -> isize;
}
#[cfg(feature = "native")]
#[export_name = #env_link]
#[unsafe(export_name = #env_link)]
#[linkage = "weak"]
pub unsafe extern "C" fn #name(#fn_params) -> isize {
#let_params
Expand Down Expand Up @@ -696,11 +696,7 @@ impl std::fmt::Display for Path<'_> {
Path::Empty => return Ok(()),
Path::Mod { name, prev } => (name, prev),
};
if f.alternate() {
write!(f, "{prev:#} ")
} else {
write!(f, "{prev}{name}_")
}
if f.alternate() { write!(f, "{prev:#} ") } else { write!(f, "{prev}{name}_") }
}
}

Expand Down
4 changes: 4 additions & 0 deletions crates/api-macro/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Update `wasefire-applet-api-desc` version

### Minor

- Use Rust edition 2024

## 0.7.0

### Major
Expand Down
2 changes: 1 addition & 1 deletion crates/api-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.8.0-git"
authors = ["Julien Cretin <[email protected]>"]
license = "Apache-2.0"
publish = true
edition = "2021"
edition = "2024"
description = "Proc-macro to generate the Wasefire applet API"
repository = "https://github.com/google/wasefire"
include = ["/LICENSE", "/src/"]
Expand Down
1 change: 1 addition & 0 deletions crates/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Minor

- Use Rust edition 2024
- Provide `bytemuck::Pod` for `ArrayU32`
- Implement `bytemuck::Pod` for `U32<T>`

Expand Down
2 changes: 1 addition & 1 deletion crates/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.7.1-git"
authors = ["Julien Cretin <[email protected]>"]
license = "Apache-2.0"
publish = true
edition = "2021"
edition = "2024"
description = "Low-level Wasefire applet API"
repository = "https://github.com/google/wasefire"
include = ["/LICENSE", "/src/"]
Expand Down
4 changes: 2 additions & 2 deletions crates/api/src/wasm/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use core::ffi::{c_char, CStr};
use core::ffi::{CStr, c_char};

use wasefire_logger as log;

#[no_mangle]
#[unsafe(no_mangle)]
#[linkage = "weak"]
pub(crate) unsafe extern "C" fn env_dispatch(link: *const c_char, _params: *const u32) -> isize {
log::panic!("{:?} is not defined", unsafe { CStr::from_ptr(link) });
Expand Down
4 changes: 4 additions & 0 deletions crates/board/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 0.8.1-git

### Minor

- Use Rust edition 2024

### Patch

- Update dependencies
Expand Down
2 changes: 1 addition & 1 deletion crates/board/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.8.1-git"
authors = ["Julien Cretin <[email protected]>"]
license = "Apache-2.0"
publish = true
edition = "2021"
edition = "2024"
description = "Wasefire board API"
repository = "https://github.com/google/wasefire"
include = ["/LICENSE", "/src/"]
Expand Down
2 changes: 1 addition & 1 deletion crates/board/src/usb/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

//! USB serial interface.
use usb_device::class_prelude::UsbBus;
use usb_device::UsbError;
use usb_device::class_prelude::UsbBus;
use usbd_serial::SerialPort;
use wasefire_logger as log;

Expand Down
1 change: 1 addition & 0 deletions crates/cli-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Minor

- Use Rust edition 2024
- Add `fs::targz_{list,extract}()` to manipulate tarballs
- Add `fs::download()` for download files

Expand Down
2 changes: 1 addition & 1 deletion crates/cli-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.2.1-git"
authors = ["Julien Cretin <[email protected]>"]
license = "Apache-2.0"
publish = true
edition = "2021"
edition = "2024"
description = "Command-line utilities for Wasefire"
repository = "https://github.com/google/wasefire"
include = ["/LICENSE", "/src/"]
Expand Down
10 changes: 5 additions & 5 deletions crates/cli-tools/src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ use std::fmt::Display;
use std::path::{Path, PathBuf};
use std::time::Duration;

use anyhow::{bail, ensure, Result};
use anyhow::{Result, bail, ensure};
use clap::{ValueEnum, ValueHint};
use rusb::GlobalContext;
use tokio::process::Command;
use wasefire_protocol::{self as service, applet, Connection, ConnectionExt};
use wasefire_protocol::{self as service, Connection, ConnectionExt, applet};
use wasefire_wire::{self as wire, Yoke};

use crate::cargo::metadata;
Expand Down Expand Up @@ -367,9 +367,9 @@ impl Transfer {
) -> Result<()>
where
S: for<'a> service::Service<
Request<'a> = service::transfer::Request<'a>,
Response<'a> = (),
>,
Request<'a> = service::transfer::Request<'a>,
Response<'a> = (),
>,
{
use wasefire_protocol::transfer::Request;
let Transfer { dry_run, chunk_size } = self;
Expand Down
2 changes: 1 addition & 1 deletion crates/cli-tools/src/action/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::path::PathBuf;
use std::str::FromStr;
use std::time::Duration;

use anyhow::{bail, ensure, Result};
use anyhow::{Result, bail, ensure};
use data_encoding::HEXLOWER_PERMISSIVE as HEX;
use rusb::{Device, GlobalContext};
use wasefire_protocol::{self as service, Connection, ConnectionExt};
Expand Down
2 changes: 1 addition & 1 deletion crates/cli-tools/src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use std::path::PathBuf;

use anyhow::{ensure, Result};
use anyhow::{Result, ensure};
use cargo_metadata::{Metadata, MetadataCommand};

pub async fn metadata(dir: impl Into<PathBuf>) -> Result<Metadata> {
Expand Down
Loading

0 comments on commit 15823da

Please sign in to comment.