Skip to content

Commit

Permalink
fix: Use 'static lifetime for CFunOptions
Browse files Browse the repository at this point in the history
This fixes another UB
  • Loading branch information
GrayJack committed Apr 23, 2024
1 parent 75e8a6c commit fe45c9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl JanetClient {
/// # }
/// ```
#[inline]
pub fn add_c_fn(&mut self, cfun_opt: CFunOptions) {
pub fn add_c_fn(&mut self, cfun_opt: CFunOptions<'static>) {
if self.env().is_none() {
self.env_table = Some(JanetEnvironment::default());
}
Expand Down
4 changes: 2 additions & 2 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl JanetEnvironment {
/// Add a C function in the environment and register it on the VM.
#[crate::cjvg("1.0.0", "1.17.0")]
#[inline]
pub fn add_c_fn(&mut self, cfun_opt: CFunOptions) {
pub fn add_c_fn(&mut self, cfun_opt: CFunOptions<'static>) {
let namespace = cfun_opt
.namespace
.map(|s| s.as_ptr())
Expand Down Expand Up @@ -121,7 +121,7 @@ impl JanetEnvironment {
/// Add a C function in the environment and register it on the VM.
#[crate::cjvg("1.17.0")]
#[inline]
pub fn add_c_fn(&mut self, cfun_opt: CFunOptions) {
pub fn add_c_fn(&mut self, cfun_opt: CFunOptions<'static>) {
let namespace = cfun_opt
.namespace
.map(|s| s.as_ptr())
Expand Down

0 comments on commit fe45c9b

Please sign in to comment.