validator: relax read_dom trait bound

This commit is contained in:
Quaternions 2025-04-05 13:29:41 -07:00
parent d53f61fb5b
commit 3ba599114d
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131
3 changed files with 5 additions and 5 deletions

@ -62,7 +62,7 @@ impl crate::message_handler::MessageHandler{
}
// decode dom (slow!)
let dom=read_dom(&mut std::io::Cursor::new(model_data)).map_err(Error::ModelFileDecode)?;
let dom=read_dom(std::io::Cursor::new(model_data)).map_err(Error::ModelFileDecode)?;
// parse create fields out of asset
let MapInfo{

@ -15,10 +15,10 @@ impl std::fmt::Display for ReadDomError{
}
impl std::error::Error for ReadDomError{}
pub fn read_dom<R:std::io::Read+std::io::Seek>(input:&mut R)->Result<rbx_dom_weak::WeakDom,ReadDomError>{
pub fn read_dom<R:std::io::Read+std::io::Seek>(mut input:R)->Result<rbx_dom_weak::WeakDom,ReadDomError>{
let mut first_8=[0u8;8];
std::io::Read::read_exact(input,&mut first_8).map_err(ReadDomError::Read)?;
std::io::Seek::rewind(input).map_err(ReadDomError::Seek)?;
std::io::Read::read_exact(&mut input,&mut first_8).map_err(ReadDomError::Read)?;
std::io::Seek::rewind(&mut input).map_err(ReadDomError::Seek)?;
match &first_8[0..4]{
b"<rob"=>{
match &first_8[4..8]{

@ -96,7 +96,7 @@ impl crate::message_handler::MessageHandler{
}).await.map_err(Error::ModelFileDownload)?;
// decode dom (slow!)
let mut dom=read_dom(&mut std::io::Cursor::new(data)).map_err(Error::ModelFileDecode)?;
let mut dom=read_dom(std::io::Cursor::new(data)).map_err(Error::ModelFileDecode)?;
/* VALIDATE MAP */