Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
updated ok method with proper semver bump (#100)
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Townsend <[email protected]>

Signed-off-by: Brooks Townsend <[email protected]>
  • Loading branch information
brooksmtownsend authored Dec 20, 2022
1 parent fec9851 commit f782b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions httpserver/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasmcloud-interface-httpserver"
version = "0.8.2"
version = "0.9.0"
description = "interface for actors to receive http requests (wasmcloud:httpserver)"
repository = "https://github.com/wasmcloud/interfaces"
homepage = "https://github.com/wasmcloud/wasmcloud"
Expand All @@ -20,7 +20,7 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
async-trait = "0.1"
serde = { version = "1.0" , features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_bytes = "0.11"
wasmbus-rpc = "0.11.1"
Expand Down
11 changes: 4 additions & 7 deletions httpserver/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ impl HttpResponse {
})
}

pub fn ok<S>(response: S) -> Result<HttpResponse, RpcError>
where
S: ToString,
{
Ok(HttpResponse {
body: response.to_string().as_bytes().to_vec(),
pub fn ok<S: Into<Vec<u8>>>(response: S) -> HttpResponse {
HttpResponse {
body: response.into(),
..Default::default()
})
}
}

/// Creates a response with a given status code, JSON-serialized payload, and headers specified by the header argument. Automatically includes the appropriate Content-Type header
Expand Down

0 comments on commit f782b67

Please sign in to comment.