diff --git a/convert-macros/tests/ui/invalid-encoding.stderr b/convert-macros/tests/ui/invalid-encoding.stderr index d22a4d7..df6fc55 100644 --- a/convert-macros/tests/ui/invalid-encoding.stderr +++ b/convert-macros/tests/ui/invalid-encoding.stderr @@ -1,6 +1,6 @@ error: encoding needs to be specified - = try: `#[encoding(ToJson)]` + = try: `#[encoding(Json)]` --> tests/ui/invalid-encoding.rs:3:10 | 3 | #[derive(ToBytes)] @@ -11,7 +11,7 @@ error: encoding needs to be specified error: expected attribute arguments in parentheses: #[encoding(...)] = note: expects a path - = try: `#[encoding(ToJson)]` + = try: `#[encoding(Json)]` --> tests/ui/invalid-encoding.rs:7:3 | 7 | #[encoding] @@ -20,7 +20,7 @@ error: expected attribute arguments in parentheses: #[encoding(...)] error: expected parentheses: #[encoding(...)] = note: expects a path - = try: `#[encoding(ToJson)]` + = try: `#[encoding(Json)]` --> tests/ui/invalid-encoding.rs:11:12 | 11 | #[encoding = "string"] @@ -29,7 +29,7 @@ error: expected parentheses: #[encoding(...)] error: unexpected token = note: expects a path - = try: `#[encoding(ToJson)]` + = try: `#[encoding(Json)]` --> tests/ui/invalid-encoding.rs:15:21 | 15 | #[encoding(something, else)] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 6e1050f..f2fdd07 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -37,7 +37,7 @@ http = ["ureq"] # enables extism_http_request cbindgen = { version = "0.28", default-features = false } [dev-dependencies] -criterion = "0.5.1" +criterion = "0.6.0" quickcheck = "1" rand = "0.9.0" diff --git a/runtime/extism.h b/runtime/extism.h index 16541a6..b029bed 100644 --- a/runtime/extism.h +++ b/runtime/extism.h @@ -156,7 +156,7 @@ void extism_current_plugin_memory_free(ExtismCurrentPlugin *plugin, ExtismMemory * - `n_outputs`: number of return types * - `func`: the function to call * - `user_data`: a pointer that will be passed to the function when it's called - * this value should live as long as the function exists + * this value should live as long as the function exists * - `free_user_data`: a callback to release the `user_data` value when the resulting * `ExtismFunction` is freed. * diff --git a/runtime/src/current_plugin.rs b/runtime/src/current_plugin.rs index a21126a..a352922 100644 --- a/runtime/src/current_plugin.rs +++ b/runtime/src/current_plugin.rs @@ -477,10 +477,7 @@ impl CurrentPlugin { offset: offs, length, }); - match s { - Ok(s) => Some(s), - Err(_) => None, - } + s.ok() } #[doc(hidden)] diff --git a/runtime/src/function.rs b/runtime/src/function.rs index 927046d..0d95f02 100644 --- a/runtime/src/function.rs +++ b/runtime/src/function.rs @@ -284,8 +284,8 @@ impl Function { /// A few things worth noting: /// - The function always returns a `Result` that wraps the specified return type /// - If a first parameter and type are passed (`_user_data` above) followed by a semicolon it will be -/// the name of the `UserData` parameter and can be used from inside the function -// definition. +/// the name of the `UserData` parameter and can be used from inside the function +// definition. #[macro_export] macro_rules! host_fn { ($pub:vis $name: ident ($($arg:ident : $argty:ty),*) $(-> $ret:ty)? $b:block) => { diff --git a/runtime/src/sdk.rs b/runtime/src/sdk.rs index ad63df3..0307cf9 100644 --- a/runtime/src/sdk.rs +++ b/runtime/src/sdk.rs @@ -180,7 +180,7 @@ pub unsafe extern "C" fn extism_current_plugin_memory_free( /// - `n_outputs`: number of return types /// - `func`: the function to call /// - `user_data`: a pointer that will be passed to the function when it's called -/// this value should live as long as the function exists +/// this value should live as long as the function exists /// - `free_user_data`: a callback to release the `user_data` value when the resulting /// `ExtismFunction` is freed. ///