Skip to content

Commit ca49128

Browse files
committed
fix: update return type
1 parent e669315 commit ca49128

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{ptr, mem};
1+
use std::ptr;
22
use thiserror::Error;
33

44
pub mod ffi {
@@ -53,7 +53,7 @@ pub mod ffi {
5353
}
5454

5555
extern "C" {
56-
pub fn ada_parse(url: *const c_char) -> ada_url;
56+
pub fn ada_parse(url: *const c_char) -> *mut ada_url;
5757
pub fn ada_free(url: *mut ada_url);
5858
pub fn ada_free_owned_string(url: *mut ada_owned_string);
5959
pub fn ada_is_valid(url: *mut ada_url) -> bool;
@@ -181,7 +181,7 @@ impl Url {
181181

182182
pub fn parse<U: AsRef<str>>(url: U) -> Result<Url, Error> {
183183
unsafe {
184-
let url_aggregator = ffi::ada_parse(url.as_ref().as_ptr().cast());
184+
let mut url_aggregator = ffi::ada_parse(url.as_ref().as_ptr().cast());
185185

186186
if ffi::ada_is_valid(url_aggregator) {
187187
Ok(Url {

0 commit comments

Comments
 (0)