mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
bumb dependencies
This commit is contained in:
parent
231e3256c5
commit
f890ff2847
3 changed files with 14 additions and 11 deletions
16
Cargo.toml
16
Cargo.toml
|
|
@ -10,15 +10,15 @@ edition = "2018"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
arrayvec = "0.5"
|
arrayvec = "0.7.2"
|
||||||
bitflags = "1.0"
|
bitflags = "1.0"
|
||||||
bv = "0.11"
|
bv = "0.11.1"
|
||||||
itertools = "0.10"
|
itertools = "0.10.3"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0.30"
|
||||||
lzma-rs = "0.1"
|
lzma-rs = "0.2.0"
|
||||||
binread = "1.0"
|
binread = "2.2.0"
|
||||||
parse-display = "0.4"
|
parse-display = "0.5.3"
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
obj = "0.10"
|
obj = "0.10"
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ impl<'a> BspFile<'a> {
|
||||||
let mut cursor = Cursor::new(raw_data);
|
let mut cursor = Cursor::new(raw_data);
|
||||||
if b"LZMA" != &<[u8; 4]>::read(&mut cursor)? {
|
if b"LZMA" != &<[u8; 4]>::read(&mut cursor)? {
|
||||||
return Err(BspError::LumpDecompressError(
|
return Err(BspError::LumpDecompressError(
|
||||||
lzma_rs::error::Error::LZMAError("Invalid lzma header".into()),
|
lzma_rs::error::Error::LzmaError("Invalid lzma header".into()),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
let actual_size: u32 = cursor.read_le()?;
|
let actual_size: u32 = cursor.read_le()?;
|
||||||
|
|
@ -71,6 +71,8 @@ impl<'a> BspFile<'a> {
|
||||||
&mut data,
|
&mut data,
|
||||||
&Options {
|
&Options {
|
||||||
unpacked_size: UnpackedSize::UseProvided(Some(actual_size as u64)),
|
unpacked_size: UnpackedSize::UseProvided(Some(actual_size as u64)),
|
||||||
|
allow_incomplete: false,
|
||||||
|
memlimit: None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.map_err(BspError::LumpDecompressError)?;
|
.map_err(BspError::LumpDecompressError)?;
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ impl fmt::Debug for Entities {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Entities<'a> {
|
struct Entities<'a> {
|
||||||
|
#[allow(dead_code)]
|
||||||
entities: Vec<Entity<'a>>,
|
entities: Vec<Entity<'a>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -178,7 +179,7 @@ bitflags! {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Display, Clone)]
|
#[derive(Debug, Display, Clone)]
|
||||||
pub struct Name(ArrayString<[u8; 64]>);
|
pub struct Name(ArrayString<64>);
|
||||||
|
|
||||||
impl BinRead for Name {
|
impl BinRead for Name {
|
||||||
type Args = ();
|
type Args = ();
|
||||||
|
|
@ -201,7 +202,7 @@ impl BinRead for Name {
|
||||||
.iter()
|
.iter()
|
||||||
.position(|c| *c == 0)
|
.position(|c| *c == 0)
|
||||||
.ok_or_else(|| binread::Error::AssertFail {
|
.ok_or_else(|| binread::Error::AssertFail {
|
||||||
pos: reader.seek(SeekFrom::Current(0)).unwrap() as usize,
|
pos: reader.seek(SeekFrom::Current(0)).unwrap(),
|
||||||
message: "Name not null terminated".to_string(),
|
message: "Name not null terminated".to_string(),
|
||||||
})?;
|
})?;
|
||||||
let name = &name_buf[..zero_pos];
|
let name = &name_buf[..zero_pos];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue