mirror of
https://github.com/noib3/nvim-oxi.git
synced 2025-08-04 19:08:31 +00:00
💅 rename loop
(both feature and module) to libuv
This commit is contained in:
parent
91f981c64e
commit
394a1b1e13
7 changed files with 8 additions and 8 deletions
|
@ -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<()> {
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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")))]
|
||||
|
|
|
@ -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,
|
Loading…
Add table
Add a link
Reference in a new issue