Skip to content

Commit 4bca870

Browse files
committed
upgrade to abi 0.0.7 ; tag 0.2.1
1 parent ebaca36 commit 4bca870

File tree

6 files changed

+64
-18
lines changed

6 files changed

+64
-18
lines changed

.github/workflows/check.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616

1717
- uses: supplypike/setup-bin@v3
1818
with:
19-
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.0-a3/cr'
19+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.21/cr'
2020
name: 'cr'
21-
version: '0.8.0-a3'
21+
version: '0.8.21'
2222

2323
- uses: supplypike/setup-bin@v3
2424
with:
25-
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.0-a3/caps'
25+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.8.21/caps'
2626
name: 'caps'
27-
version: '0.8.0-a3'
27+
version: '0.8.21'
2828

2929
- uses: actions-rs/toolchain@v1
3030
with:

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "calcit_wss"
3-
version = "0.2.0-a2"
3+
version = "0.2.1"
44
authors = ["jiyinyiyong <[email protected]>"]
55
edition = "2021"
66

@@ -13,7 +13,7 @@ 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.4.2"
16+
cirru_edn = "0.5.4"
1717
lazy_static = "1.4.0"
1818
simple-websockets = "0.1.6"
1919

calcit.cirru

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compact.cirru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
{} (:package |wss)
3-
:configs $ {} (:init-fn |wss.test/main!) (:reload-fn |wss.test/reload!) (:version |0.2.0-a3)
3+
:configs $ {} (:init-fn |wss.test/main!) (:reload-fn |wss.test/reload!) (:version |0.2.1)
44
:modules $ []
55
:entries $ {}
66
:files $ {}

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ lazy_static! {
1111

1212
#[no_mangle]
1313
pub fn abi_version() -> String {
14-
String::from("0.0.6")
14+
String::from("0.0.7")
1515
}
1616

1717
#[no_mangle]
@@ -20,7 +20,7 @@ pub fn wss_serve(
2020
handler: Arc<dyn Fn(Vec<Edn>) -> Result<Edn, String> + Send + Sync + 'static>,
2121
_finish: Box<dyn FnOnce()>,
2222
) -> Result<Edn, String> {
23-
let port = match args.get(0) {
23+
let port = match args.first() {
2424
Some(Edn::Map(m)) => match m.get(&Edn::tag("port")) {
2525
Some(Edn::Number(n)) => n.floor().round() as u16,
2626
Some(a) => return Err(format!("Unknown port: {}", a)),
@@ -44,7 +44,7 @@ pub fn wss_serve(
4444
let mut clients = CLIENTS.write().unwrap();
4545
clients.insert(client_id, responder);
4646
}
47-
if let Err(e) = handler(vec![Edn::Tuple(Box::new(Edn::tag("connect")), vec![Edn::Number(client_id as f64)])]) {
47+
if let Err(e) = handler(vec![Edn::Tuple(Arc::new(Edn::tag("connect")), vec![Edn::Number(client_id as f64)])]) {
4848
println!("Failed to handle connect: {}", e)
4949
}
5050
}
@@ -55,7 +55,7 @@ pub fn wss_serve(
5555
clients.remove(&client_id);
5656
}
5757
if let Err(e) = handler(vec![Edn::Tuple(
58-
Box::new(Edn::tag("disconnect")),
58+
Arc::new(Edn::tag("disconnect")),
5959
vec![Edn::Number(client_id as f64)],
6060
)]) {
6161
println!("Failed to handle disconnect: {}", e)
@@ -64,15 +64,15 @@ pub fn wss_serve(
6464
Event::Message(client_id, message) => match message {
6565
Message::Text(s) => {
6666
if let Err(e) = handler(vec![Edn::Tuple(
67-
Box::new(Edn::tag("message")),
68-
vec![Edn::Number(client_id as f64), Edn::Str(s.into_boxed_str())],
67+
Arc::new(Edn::tag("message")),
68+
vec![Edn::Number(client_id as f64), Edn::Str(s.into())],
6969
)]) {
7070
println!("Failed to handle text message: {}", e)
7171
}
7272
}
7373
Message::Binary(buf) => {
7474
if let Err(e) = handler(vec![Edn::Tuple(
75-
Box::new(Edn::tag("blob")),
75+
Arc::new(Edn::tag("blob")),
7676
vec![Edn::Number(client_id as f64), Edn::Buffer(buf)],
7777
)]) {
7878
println!("Failed to handle binary message: {}", e)

0 commit comments

Comments
 (0)