Fix clippy warnings

This commit is contained in:
Alex Orlenko 2021-10-12 12:02:42 +01:00
parent 25a4879cde
commit cab2e5a48e
No known key found for this signature in database
GPG Key ID: 4C150C250863B96D
2 changed files with 3 additions and 3 deletions

View File

@ -3118,7 +3118,7 @@ impl<'lua, T: 'static + UserData> UserDataFields<'lua, T> for StaticUserDataFiel
{
self.field_getters.push((
name.as_ref().to_vec(),
StaticUserDataMethods::<T>::box_function(move |lua, data| function(lua, data)),
StaticUserDataMethods::<T>::box_function(function),
));
}

View File

@ -752,9 +752,9 @@ pub unsafe fn init_error_registry(state: *mut ffi::lua_State) -> Result<()> {
(Some(error1), Some(error0)) => {
let _ = write!(&mut (*err_buf), "\ncaused by: {}", error0);
let s = error1.to_string();
if let Some(traceback) = s.splitn(2, "\nstack traceback:\n").nth(1) {
if let Some(traceback) = s.split_once("\nstack traceback:\n") {
let _ =
write!(&mut (*err_buf), "\nstack traceback:\n{}", traceback);
write!(&mut (*err_buf), "\nstack traceback:\n{}", traceback.1);
}
}
(Some(error1), None) => {