Skip to content

Commit

Permalink
deps: update wit-bindgen 0.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitea committed Mar 30, 2024
1 parent 2c8e65a commit 1988e10
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 118 deletions.
149 changes: 58 additions & 91 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ tracing-subscriber = { version = "0.3.18", features = [
"env-filter",
] }
uuid = { version = "1.8.0", features = ["v4"] }
wit-bindgen = "0.22.0"
wit-bindgen-core = "0.22.0"
wit-bindgen-rust = "0.22.0"
wit-bindgen = "0.23.0"
wit-bindgen-core = "0.23.0"
wit-bindgen-rust = "0.23.0"
wit-component = "0.202.0"
url = "2.5.0"
2 changes: 1 addition & 1 deletion crates/kernel/src/tasks/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub async fn init() -> Result<()> {
let _ = deployment::mark_status(
deploy_id,
deployment::DeployStatus::Failed,
format!("failed:{}", e.to_string()),
format!("failed:{}", e),
None,
None,
)
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = { workspace = true }
anyhow = { workspace = true }
http = { workspace = true }
quote = "1.0.35"
syn = { version = "2.0.55", features = ["full"] }
syn = { version = "2.0.57", features = ["full"] }

[lib]
proc-macro = true
Expand Down
28 changes: 20 additions & 8 deletions crates/sdk-macro/src/http_handler.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Generated by `wit-bindgen` 0.22.0. DO NOT EDIT!
// Generated by `wit-bindgen` 0.23.0. DO NOT EDIT!
// Options used:
// * pub-export-macro
#[allow(dead_code)]
pub mod land {
#[allow(dead_code)]
pub mod http {
#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod types {
#[used]
#[doc(hidden)]
Expand Down Expand Up @@ -159,10 +161,13 @@ pub mod land {
}
}
}
#[allow(dead_code)]
pub mod exports {
#[allow(dead_code)]
pub mod land {
#[allow(dead_code)]
pub mod http {
#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod incoming {
#[used]
#[doc(hidden)]
Expand All @@ -184,6 +189,8 @@ pub mod exports {
arg6: i32,
arg7: i32,
) -> *mut u8 {
#[cfg(target_arch = "wasm32")]
_rt::run_ctors_once();
let len0 = arg1;
let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0);
let len1 = arg3;
Expand Down Expand Up @@ -326,6 +333,11 @@ pub mod exports {
mod _rt {
pub use alloc_crate::string::String;
pub use alloc_crate::vec::Vec;

#[cfg(target_arch = "wasm32")]
pub fn run_ctors_once() {
wit_bindgen::rt::run_ctors_once();
}
pub unsafe fn string_lift(bytes: Vec<u8>) -> String {
if cfg!(debug_assertions) {
String::from_utf8(bytes).unwrap()
Expand Down Expand Up @@ -447,7 +459,7 @@ macro_rules! __export_http_handler_impl {
const _: () = {

#[cfg(target_arch = "wasm32")]
#[link_section = "component-type:wit-bindgen:0.22.0:http-handler:imports and exports"]
#[link_section = "component-type:wit-bindgen:0.23.0:http-handler:imports and exports"]
#[doc(hidden)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 692] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xb1\x04\x01A\x02\x01\
Expand All @@ -464,16 +476,16 @@ edirect\x13\x04\0\x0frequest-options\x03\0\x14\x03\x01\x0fland:http/types\x05\0\
request\x03\0\0\x02\x03\x02\x01\x02\x04\0\x08response\x03\0\x02\x01@\x01\x03req\x01\
\0\x03\x04\0\x0ehandle-request\x01\x04\x04\x01\x12land:http/incoming\x05\x03\x04\
\x01\x18land:worker/http-handler\x04\0\x0b\x12\x01\0\x0chttp-handler\x03\0\0\0G\x09\
producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rus\
t\x060.22.0";
producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-bindgen-rus\
t\x060.23.0";
};
)
}
#[doc(inline)]
pub use __export_http_handler_impl as export;

#[cfg(target_arch = "wasm32")]
#[link_section = "component-type:wit-bindgen:0.22.0:http-handler-with-all-of-its-exports-removed:encoded world"]
#[link_section = "component-type:wit-bindgen:0.23.0:http-handler-with-all-of-its-exports-removed:encoded world"]
#[doc(hidden)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 639] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xdc\x03\x01A\x02\x01\
Expand All @@ -488,7 +500,7 @@ eout\0\0\x0binvalid-url\0\0\x17destination-not-allowed\0\0\x11too-many-requests\
edirect\x13\x04\0\x0frequest-options\x03\0\x14\x03\x01\x0fland:http/types\x05\0\x04\
\x018land:worker/http-handler-with-all-of-its-exports-removed\x04\0\x0b2\x01\0,h\
ttp-handler-with-all-of-its-exports-removed\x03\0\0\0G\x09producers\x01\x0cproce\
ssed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x060.22.0";
ssed-by\x02\x0dwit-component\x070.202.0\x10wit-bindgen-rust\x060.23.0";

#[inline(never)]
#[doc(hidden)]
Expand Down
16 changes: 9 additions & 7 deletions crates/sdk/src/http_service.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Generated by `wit-bindgen` 0.22.0. DO NOT EDIT!
// Generated by `wit-bindgen` 0.23.0. DO NOT EDIT!
// Options used:
// * pub-export-macro
#[allow(dead_code)]
pub mod land {
#[allow(dead_code)]
pub mod http {
#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod types {
#[used]
#[doc(hidden)]
Expand Down Expand Up @@ -158,7 +160,7 @@ pub mod land {
}
}

#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod body {
#[used]
#[doc(hidden)]
Expand Down Expand Up @@ -596,7 +598,7 @@ pub mod land {
}
}

#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod outgoing {
#[used]
#[doc(hidden)]
Expand Down Expand Up @@ -927,7 +929,7 @@ mod _rt {
}

#[cfg(target_arch = "wasm32")]
#[link_section = "component-type:wit-bindgen:0.22.0:http-service-with-all-of-its-exports-removed:encoded world"]
#[link_section = "component-type:wit-bindgen:0.23.0:http-service-with-all-of-its-exports-removed:encoded world"]
#[doc(hidden)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 1169] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xee\x07\x01A\x02\x01\
Expand Down Expand Up @@ -955,8 +957,8 @@ response\x03\0\x02\x02\x03\x02\x01\x05\x04\0\x0drequest-error\x03\0\x04\x02\x03\
\x01\x07options\x07\0\x08\x04\0\x0dfetch-request\x01\x09\x03\x01\x12land:http/ou\
tgoing\x05\x07\x04\x018land:worker/http-service-with-all-of-its-exports-removed\x04\
\0\x0b2\x01\0,http-service-with-all-of-its-exports-removed\x03\0\0\0G\x09produce\
rs\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x060.\
22.0";
rs\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-bindgen-rust\x060.\
23.0";

#[inline(never)]
#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion examples/http-rust/Cargo.toml.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "{{description}}"
anyhow = "1.0.80"
http = "1.0.0"
land-sdk = {{sdk_version}}
wit-bindgen = "0.21.0"
wit-bindgen = "0.23.0"

[lib]
crate-type = ["cdylib"]
10 changes: 4 additions & 6 deletions land-server/src/server/dash/traffic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub async fn requests(
}

fn get_flow_query(acc: String, project: Option<String>, step: String) -> String {
let query = if let Some(pid) = project {
if let Some(pid) = project {
format!(
"sum by (project_id,flowtype) (increase(req_fn_bytes_total{{project_id=\"{}\"}}[{}]))",
pid, step,
Expand All @@ -137,12 +137,11 @@ fn get_flow_query(acc: String, project: Option<String>, step: String) -> String
"sum by (user_id,flowtype) (increase(req_fn_bytes_total{{user_id=\"{}\"}}[{}]))",
acc, step,
)
};
query
}
}

fn get_request_query(acc: String, project: Option<String>, step: String) -> String {
let query = if let Some(pid) = project {
if let Some(pid) = project {
format!(
"sum(increase(req_fn_total{{project_id=\"{}\",status=\"all\"}}[{}]))",
pid, step,
Expand All @@ -152,6 +151,5 @@ fn get_request_query(acc: String, project: Option<String>, step: String) -> Stri
"sum(increase(req_fn_total{{user_id=\"{}\",status=\"all\"}}[{}]))",
acc, step,
)
};
query
}
}

0 comments on commit 1988e10

Please sign in to comment.