Skip to content

Commit ad480f8

Browse files
author
zach
authored
cleanup: improve macro hygiene (#79)
* cleanup: improve macro hygene * chore: bump versions
1 parent d29fe0f commit ad480f8

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "extism-pdk"
3-
version = "1.4.0"
3+
version = "1.4.1"
44
edition = "2021"
55
authors = ["The Extism Authors", "[email protected]"]
66
license = "BSD-3-Clause"
@@ -12,7 +12,7 @@ description = "Extism Plug-in Development Kit (PDK) for Rust"
1212
anyhow = "1"
1313
serde = { version = "1", features = ["derive"] }
1414
serde_json = "1"
15-
extism-pdk-derive = { path = "./derive", version = "1.4.0" }
15+
extism-pdk-derive = { path = "./derive", version = "1.4.1" }
1616
extism-manifest = { version = "1.10.0", optional = true }
1717
extism-convert = { version = "1.10.0", features = ["extism-pdk-path"] }
1818
base64 = "0.22.1"

derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "extism-pdk-derive"
3-
version = "1.4.0"
3+
version = "1.4.1"
44
edition = "2021"
55
authors = ["The Extism Authors", "[email protected]"]
66
license = "BSD-3-Clause"

derive/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ pub fn plugin_fn(
7373
}
7474

7575
let output = match inner() {
76-
Ok(x) => x,
77-
Err(rc) => {
76+
core::result::Result::Ok(x) => x,
77+
core::result::Result::Err(rc) => {
7878
let err = format!("{:?}", rc.0);
7979
let mut mem = extism_pdk::Memory::from_bytes(&err).unwrap();
8080
unsafe {
@@ -98,8 +98,8 @@ pub fn plugin_fn(
9898

9999
let input = extism_pdk::unwrap!(extism_pdk::input());
100100
let output = match inner(input) {
101-
Ok(x) => x,
102-
Err(rc) => {
101+
core::result::Result::Ok(x) => x,
102+
core::result::Result::Err(rc) => {
103103
let err = format!("{:?}", rc.0);
104104
let mut mem = extism_pdk::Memory::from_bytes(&err).unwrap();
105105
unsafe {
@@ -238,10 +238,10 @@ pub fn shared_fn(
238238

239239
let r = || inner(#(#raw_args,)*);
240240
match r().and_then(|x| extism_pdk::Memory::new(&x)) {
241-
Ok(mem) => {
241+
core::result::Result::Ok(mem) => {
242242
mem.offset()
243243
},
244-
Err(rc) => {
244+
core::result::Result::Err(rc) => {
245245
panic!("{}", rc.to_string());
246246
}
247247
}
@@ -330,7 +330,7 @@ pub fn host_fn(
330330

331331
#impl_block
332332

333-
#vis unsafe fn #name #generics (#original_inputs) -> Result<#output, extism_pdk::Error> {
333+
#vis unsafe fn #name #generics (#original_inputs) -> core::result::Result<#output, extism_pdk::Error> {
334334
let res = extism_pdk::Memory::from(#impl_name(#(#into_inputs),*));
335335
<#output as extism_pdk::FromBytes>::from_bytes(&res.to_vec())
336336
}
@@ -341,9 +341,9 @@ pub fn host_fn(
341341

342342
#impl_block
343343

344-
#vis unsafe fn #name #generics (#original_inputs) -> Result<#output, extism_pdk::Error> {
344+
#vis unsafe fn #name #generics (#original_inputs) -> core::result::Result<#output, extism_pdk::Error> {
345345
let res = #impl_name(#(#into_inputs),*);
346-
Ok(res)
346+
core::result::Result::Ok(res)
347347
}
348348
};
349349
}

test/code.wasm

1.54 KB
Binary file not shown.

test/host_function.wasm

3.59 KB
Binary file not shown.

test/http.wasm

2.98 KB
Binary file not shown.

test/http_headers.wasm

4.07 KB
Binary file not shown.

0 commit comments

Comments
 (0)