update Rust dependencies

This pulls in a duplicate version of `thiserror` for now, but oh well.
This commit is contained in:
Scott Lamb
2025-01-25 10:18:15 -08:00
parent cbb2c30b56
commit dd30d5bcf8
12 changed files with 569 additions and 385 deletions

View File

@@ -5,7 +5,7 @@ authors = ["Scott Lamb <slamb@slamb.org>"]
readme = "../README.md"
edition = "2021"
license-file = "../../LICENSE.txt"
rust-version = "1.81"
rust-version = "1.82"
publish = false
[features]
@@ -23,13 +23,12 @@ cstr = "0.2.5"
diff = "0.1.12"
futures = "0.3"
h264-reader = { workspace = true }
hashlink = "0.9.1"
hashlink = "0.10.0"
itertools = { workspace = true }
jiff = { workspace = true }
libc = "0.2"
nix = { workspace = true, features = ["dir", "feature", "fs", "mman"] }
num-rational = { version = "0.4.0", default-features = false, features = ["std"] }
odds = { version = "0.4.0", features = ["std-vec"] }
pretty-hex = { workspace = true }
protobuf = "3.0"
ring = { workspace = true }

View File

@@ -13,7 +13,6 @@ use crate::coding;
use crate::db::CompositeId;
use crate::schema;
use base::{bail, err, Error};
use cstr::cstr;
use nix::sys::statvfs::Statvfs;
use nix::{
fcntl::{FlockArg, OFlag},
@@ -134,7 +133,7 @@ impl Fd {
/// Reads `dir`'s metadata. If none is found, returns an empty proto.
pub(crate) fn read_meta(dir: &Fd) -> Result<schema::DirMeta, Error> {
let mut meta = schema::DirMeta::default();
let mut f = match crate::fs::openat(dir.0, cstr!("meta"), OFlag::O_RDONLY, Mode::empty()) {
let mut f = match crate::fs::openat(dir.0, c"meta", OFlag::O_RDONLY, Mode::empty()) {
Err(e) => {
if e == nix::Error::ENOENT {
return Ok(meta);
@@ -184,7 +183,7 @@ pub(crate) fn write_meta(dirfd: RawFd, meta: &schema::DirMeta) -> Result<(), Err
data.resize(FIXED_DIR_META_LEN, 0); // pad to required length.
let mut f = crate::fs::openat(
dirfd,
cstr!("meta"),
c"meta",
OFlag::O_CREAT | OFlag::O_WRONLY,
Mode::S_IRUSR | Mode::S_IWUSR,
)

View File

@@ -9,7 +9,6 @@
use crate::db::SqlUuid;
use crate::{dir, schema};
use base::{bail, err, Error};
use cstr::cstr;
use nix::fcntl::{FlockArg, OFlag};
use nix::sys::stat::Mode;
use protobuf::Message;
@@ -24,8 +23,8 @@ const FIXED_DIR_META_LEN: usize = 512;
/// Maybe upgrades the `meta` file, returning if an upgrade happened (and thus a sync is needed).
fn maybe_upgrade_meta(dir: &dir::Fd, db_meta: &schema::DirMeta) -> Result<bool, Error> {
let tmp_path = cstr!("meta.tmp");
let meta_path = cstr!("meta");
let tmp_path = c"meta.tmp";
let meta_path = c"meta";
let mut f = crate::fs::openat(
dir.as_fd().as_raw_fd(),
meta_path,