Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tizoc committed Jan 28, 2024
1 parent b21f365 commit f4e2abc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/compile_ok_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod test_immediate_ocamlrefs {

#[test]
fn test_immediate_ocamlrefs() {
let mut cr = unsafe { OCamlRuntime::recover_handle() };
assert!(test_immediate_ocamlref(&mut cr));
let cr = unsafe { OCamlRuntime::recover_handle() };
assert!(test_immediate_ocamlref(cr));
}
}
12 changes: 6 additions & 6 deletions src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ pub fn alloc_double(cr: &mut OCamlRuntime, d: f64) -> OCaml<OCamlFloat> {
// small values (like tuples and conses are) without going through `caml_modify` to get
// a little bit of extra performance.

pub fn alloc_some<'a, 'b, A>(
pub fn alloc_some<'a, A>(
cr: &'a mut OCamlRuntime,
value: OCamlRef<'b, A>,
value: OCamlRef<'_, A>,
) -> OCaml<'a, Option<A>> {
unsafe {
let ocaml_some = caml_alloc(1, tag::SOME);
Expand All @@ -103,9 +103,9 @@ pub fn alloc_some<'a, 'b, A>(
}
}

pub fn alloc_ok<'a, 'b, A, Err>(
pub fn alloc_ok<'a, A, Err>(
cr: &'a mut OCamlRuntime,
value: OCamlRef<'b, A>,
value: OCamlRef<'_, A>,
) -> OCaml<'a, Result<A, Err>> {
unsafe {
let ocaml_ok = caml_alloc(1, tag::TAG_OK);
Expand All @@ -114,9 +114,9 @@ pub fn alloc_ok<'a, 'b, A, Err>(
}
}

pub fn alloc_error<'a, 'b, A, Err>(
pub fn alloc_error<'a, A, Err>(
cr: &'a mut OCamlRuntime,
err: OCamlRef<'b, Err>,
err: OCamlRef<'_, Err>,
) -> OCaml<'a, Result<A, Err>> {
unsafe {
let ocaml_err = caml_alloc(1, tag::TAG_ERROR);
Expand Down
2 changes: 1 addition & 1 deletion src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl OCamlRuntime {

INIT.call_once(|| {
let arg0 = "ocaml\0".as_ptr() as *const ocaml_sys::Char;
let c_args = vec![arg0, core::ptr::null()];
let c_args = [arg0, core::ptr::null()];
unsafe {
ocaml_sys::caml_startup(c_args.as_ptr());
}
Expand Down

0 comments on commit f4e2abc

Please sign in to comment.