Skip to content

Commit 5f38445

Browse files
committed
Fix warnings
1 parent df0a44d commit 5f38445

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/state/extra.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_hash::FxHashMap;
1212
use crate::error::Result;
1313
use crate::state::RawLua;
1414
use crate::stdlib::StdLib;
15-
use crate::types::{AppData, ReentrantMutex, ValueRefIndex, XRc};
15+
use crate::types::{AppData, ReentrantMutex, XRc};
1616
use crate::userdata::RawUserDataRegistry;
1717
use crate::util::{get_internal_metatable, push_internal_userdata, TypeKey, WrappedFailure};
1818

@@ -64,7 +64,7 @@ pub(crate) struct ExtraData {
6464
pub(super) wrapped_failure_top: usize,
6565
// Pool of `Thread`s (coroutines) for async execution
6666
#[cfg(feature = "async")]
67-
pub(super) thread_pool: Vec<ValueRefIndex>,
67+
pub(super) thread_pool: Vec<crate::types::ValueRefIndex>,
6868

6969
// Address of `WrappedFailure` metatable
7070
pub(super) wrapped_failure_mt_ptr: *const c_void,

src/types.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ pub(crate) type BoxFuture<'a, T> = futures_util::future::LocalBoxFuture<'a, T>;
1818
pub use app_data::{AppData, AppDataRef, AppDataRefMut};
1919
pub use either::Either;
2020
pub use registry_key::RegistryKey;
21-
pub(crate) use value_ref::{ValueRef, ValueRefIndex};
21+
pub(crate) use value_ref::ValueRef;
22+
23+
#[cfg(feature = "async")]
24+
pub(crate) use value_ref::ValueRefIndex;
2225

2326
/// Type of Lua integer numbers.
2427
pub type Integer = ffi::lua_Integer;

tests/scope.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ fn test_scope_userdata_ref() -> Result<()> {
382382
modify_userdata(&lua, &ud)?;
383383

384384
// We can only borrow userdata scoped
385-
assert!((matches!(ud.borrow::<MyUserData>(), Err(Error::UserDataTypeMismatch))));
385+
#[rustfmt::skip]
386+
assert!(matches!(ud.borrow::<MyUserData>(), Err(Error::UserDataTypeMismatch)));
386387
ud.borrow_scoped::<MyUserData, ()>(|ud_inst| {
387388
assert_eq!(ud_inst.0.get(), 2);
388389
})?;
@@ -419,7 +420,8 @@ fn test_scope_userdata_ref_mut() -> Result<()> {
419420
let ud = scope.create_userdata_ref_mut(&mut data)?;
420421
modify_userdata(&lua, &ud)?;
421422

422-
assert!((matches!(ud.borrow_mut::<MyUserData>(), Err(Error::UserDataTypeMismatch))));
423+
#[rustfmt::skip]
424+
assert!(matches!(ud.borrow_mut::<MyUserData>(), Err(Error::UserDataTypeMismatch)));
423425
ud.borrow_mut_scoped::<MyUserData, ()>(|ud_inst| {
424426
ud_inst.0 += 10;
425427
})?;

0 commit comments

Comments
 (0)