Skip to content

Commit 659d5a4

Browse files
committed
update deps and api version; tag 0.0.7
1 parent 1614785 commit 659d5a4

File tree

6 files changed

+55
-82
lines changed

6 files changed

+55
-82
lines changed

.rustfmt.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
max_width = 136
3+
tab_spaces = 2

Cargo.lock

Lines changed: 38 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "calcit_http"
3-
version = "0.0.6"
3+
version = "0.0.7"
44
authors = ["jiyinyiyong <[email protected]>"]
55
edition = "2018"
66

@@ -13,6 +13,6 @@ crate-type = ["dylib"] # Creates dynamic lib
1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

1515
[dependencies]
16-
cirru_edn = "0.2.8"
17-
cirru_parser = "0.1.12"
18-
tiny_http = "0.9"
16+
cirru_edn = "0.2.14"
17+
cirru_parser = "0.1.18"
18+
tiny_http = "0.11.0"

calcit.cirru

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compact.cirru

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
:configs $ {} (:init-fn |http.test/main!) (:reload-fn |http.test/reload!)
44
:modules $ []
55
:version |0.0.6
6+
:entries $ {}
7+
:server $ {} (:init-fn |http.test/demo-server!) (:reload-fn |http.test/reload!)
8+
:modules $ []
69
:files $ {}
710
|http.core $ {}
811
:ns $ quote

src/lib.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct ResponseSkeleton {
1616

1717
#[no_mangle]
1818
pub fn abi_version() -> String {
19-
String::from("0.0.5")
19+
String::from("0.0.6")
2020
}
2121

2222
#[no_mangle]
@@ -47,20 +47,14 @@ pub fn serve_http(
4747
let mut headers: HashMap<Edn, Edn> = HashMap::new();
4848

4949
for pair in request.headers() {
50-
headers.insert(
51-
Edn::kwd(&pair.field.to_string()),
52-
Edn::str(pair.value.to_string()),
53-
);
50+
headers.insert(Edn::kwd(&pair.field.to_string()), Edn::str(pair.value.to_string()));
5451
}
5552
m.insert(Edn::kwd("headers"), Edn::Map(headers));
5653

5754
if request.method() != &Method::Get {
5855
let mut content = String::new();
5956
request.as_reader().read_to_string(&mut content).unwrap();
60-
m.insert(
61-
Edn::kwd("body"),
62-
Edn::Str(content.to_string().into_boxed_str()),
63-
);
57+
m.insert(Edn::kwd("body"), Edn::Str(content.to_string().into_boxed_str()));
6458
}
6559

6660
let info = Edn::Map(m);
@@ -70,11 +64,7 @@ pub fn serve_http(
7064
let mut response = Response::from_string(res.body.to_string()).with_status_code(res.code);
7165

7266
for (field, value) in res.headers {
73-
response.add_header(
74-
format!("{}: {}", field, value)
75-
.parse::<tiny_http::Header>()
76-
.unwrap(),
77-
);
67+
response.add_header(format!("{}: {}", field, value).parse::<tiny_http::Header>().unwrap());
7868
}
7969
request.respond(response).map_err(|x| x.to_string())?;
8070
}

0 commit comments

Comments
 (0)