💅 rename loop (both feature and module) to libuv

This commit is contained in:
noib3 2022-09-24 19:43:30 +02:00
parent 91f981c64e
commit 394a1b1e13
No known key found for this signature in database
GPG key ID: 7AF92216C504A017
7 changed files with 8 additions and 8 deletions

View file

@ -1,4 +1,4 @@
use nvim_oxi::{self as oxi, r#loop};
use nvim_oxi::{self as oxi, libuv};
#[oxi::module]
fn libuv() -> oxi::Result<()> {

View file

@ -16,7 +16,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[features]
loop = ["dep:libuv-sys2"]
libuv = ["dep:libuv-sys2"]
mlua = ["dep:mlua"]
nightly = ["nvim-types/nightly"]
test = ["dep:oxi-test"]
@ -39,4 +39,4 @@ thiserror = "1.0"
name = "libuv"
path = "../examples/libuv.rs"
crate-type = ["cdylib"]
required-features = ["loop"]
required-features = ["libuv"]

View file

@ -38,9 +38,9 @@ pub mod types {
}
// Public modules behind feature flags.
#[cfg(feature = "loop")]
#[cfg_attr(docsrs, doc(cfg(feature = "loop")))]
pub mod r#loop;
#[cfg(feature = "libuv")]
#[cfg_attr(docsrs, doc(cfg(feature = "libuv")))]
pub mod libuv;
#[cfg(feature = "mlua")]
#[cfg_attr(docsrs, doc(cfg(feature = "mlua")))]

View file

@ -12,12 +12,12 @@ thread_local! {
static LOOP: OnceCell<*mut uv_loop_t> = OnceCell::new();
}
#[inline]
/// TODO: docs
pub(crate) unsafe fn init_loop(lstate: *mut lua::lua_State) {
LOOP.with(|main_loop| main_loop.set(luv_loop(lstate)).unwrap_unchecked());
}
#[inline]
/// TODO: docs
pub(crate) unsafe fn with_loop<F, R>(fun: F) -> R
where
F: FnOnce(*mut uv_loop_t) -> R,