Update dependencies; fix breakage

This commit is contained in:
hvithrafn 2021-02-26 10:55:20 -07:00
parent c25fa9910e
commit 05f79f0f90
6 changed files with 331 additions and 490 deletions

View file

@ -105,6 +105,12 @@ impl From<glob::GlobError> for Error {
}
}
impl From<libloading::Error> for Error {
fn from(error: libloading::Error) -> Self {
Error::new(error.to_string())
}
}
impl From<regex_syntax::ast::Error> for Error {
fn from(error: regex_syntax::ast::Error) -> Self {
Error::new(error.to_string())

View file

@ -346,7 +346,7 @@ impl Loader {
}
}
let library = Library::new(&library_path).map_err(Error::wrap(|| {
let library = unsafe { Library::new(&library_path) }.map_err(Error::wrap(|| {
format!("Error opening dynamic library {:?}", &library_path)
}))?;
let language_fn_name = format!("tree_sitter_{}", replace_dashes_with_underscores(name));

View file

@ -13,7 +13,7 @@ impl Rand {
}
pub fn unsigned(&mut self, max: usize) -> usize {
self.0.gen_range(0, max + 1)
self.0.gen_range(0 .. max + 1)
}
pub fn words(&mut self, max_count: usize) -> Vec<u8> {