Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace all generic contexts with a single Cx type #1048

Merged
merged 7 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions crates/neon/src/context/internal.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{cell::RefCell, ffi::c_void, mem::MaybeUninit};

use crate::{
context::ModuleContext,
context::{Cx, ModuleContext},
handle::Handle,
result::NeonResult,
sys::{self, raw},
Expand Down Expand Up @@ -46,8 +46,12 @@ impl Env {
}
}

pub trait ContextInternal<'a>: Sized {
fn env(&self) -> Env;
pub trait ContextInternal<'cx>: Sized {
fn cx(&self) -> &Cx<'cx>;
fn cx_mut(&mut self) -> &mut Cx<'cx>;
fn env(&self) -> Env {
self.cx().env
}
}

fn default_main(mut cx: ModuleContext) -> NeonResult<()> {
Expand Down
Loading