Merge pull request #945 from hvithrafn/update-dependencies

Update dependencies; fix breakage
This commit is contained in:
Max Brunsfeld 2021-03-01 09:15:38 -08:00 committed by GitHub
commit 3f315f167b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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> {