warp/warp-args/src/lib.rs
Reisz d9aeb582a2 Upgrade to Rust 2021
- Fix lints
- Formatting pass
- Add Cargo.lock

Use anyhow to improve error handling

Fix errors during directory removal in Windows

Update dependencies

Switch linux build to musl

Switch to musl

Set version to 0.4.0

Allow using uid instead of mtime

Remove name duplication with runner map

Fixing typo
2024-05-16 08:33:21 +02:00

23 lines
598 B
Rust

use std::path::PathBuf;
use bincode::Options;
use serde::{Deserialize, Serialize};
pub const WARP_ARGS_MAGIC: &[u8] = b"DR1PWsJsM6KxNbng9Y38";
#[derive(Serialize, Deserialize, Debug)]
pub struct Args {
pub target_file_name: PathBuf,
pub prefix: Option<PathBuf>,
pub uid: Option<String>,
pub clean: bool,
}
pub fn bincode_options() -> impl bincode::Options {
bincode::DefaultOptions::new()
.with_fixint_encoding()
.allow_trailing_bytes()
// Make sure bincode does not trust all size prefixes while scanning the binary
.with_limit(1_000_000)
}