Skip to content

Commit 2c675d2

Browse files
committed
upgrade calcit 0.7 ; tag 0.1.0
1 parent f897772 commit 2c675d2

File tree

4 files changed

+50
-47
lines changed

4 files changed

+50
-47
lines changed

.github/workflows/check.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ jobs:
1212
name: Test
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
17-
- name: ACTIONS_ALLOW_UNSECURE_COMMANDS
18-
id: ACTIONS_ALLOW_UNSECURE_COMMANDS
19-
run: echo 'ACTIONS_ALLOW_UNSECURE_COMMANDS=true' >> $GITHUB_ENV
20-
21-
- name: add cr
22-
run: |
23-
mkdir -p $GITHUB_WORKSPACE/bin
24-
wget -O $GITHUB_WORKSPACE/bin/cr https://github.com/calcit-lang/calcit/releases/download/0.6.13/cr
25-
chmod +x $GITHUB_WORKSPACE/bin/cr
26-
echo "::add-path::$GITHUB_WORKSPACE/bin"
15+
- uses: actions/checkout@v3
16+
17+
- uses: supplypike/setup-bin@v3
18+
with:
19+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.7.0-a3/cr'
20+
name: 'cr'
21+
version: '0.7.0-a3'
22+
23+
- uses: supplypike/setup-bin@v3
24+
with:
25+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.7.0-a3/caps'
26+
name: 'caps'
27+
version: '0.7.0-a3'
2728

2829
- uses: actions-rs/toolchain@v1
2930
with:

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "calcit_wss"
3-
version = "0.0.7"
3+
version = "0.1.0"
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.2.21"
16+
cirru_edn = "0.4.0"
1717
lazy_static = "1.4.0"
18-
simple-websockets = "0.1.4"
18+
simple-websockets = "0.1.5"
1919

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn wss_serve(
2121
_finish: Box<dyn FnOnce()>,
2222
) -> Result<Edn, String> {
2323
let port = match args.get(0) {
24-
Some(Edn::Map(m)) => match m.get(&Edn::kwd("port")) {
24+
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)),
2727
None => 9001,
@@ -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::List(vec![Edn::kwd("connect"), Edn::Number(client_id as f64)])]) {
47+
if let Err(e) = handler(vec![Edn::List(vec![Edn::tag("connect"), Edn::Number(client_id as f64)])]) {
4848
println!("Failed to handle connect: {}", e)
4949
}
5050
}
@@ -54,14 +54,14 @@ pub fn wss_serve(
5454
let mut clients = CLIENTS.write().unwrap();
5555
clients.remove(&client_id);
5656
}
57-
if let Err(e) = handler(vec![Edn::List(vec![Edn::kwd("disconnect"), Edn::Number(client_id as f64)])]) {
57+
if let Err(e) = handler(vec![Edn::List(vec![Edn::tag("disconnect"), Edn::Number(client_id as f64)])]) {
5858
println!("Failed to handle disconnect: {}", e)
5959
}
6060
}
6161
Event::Message(client_id, message) => match message {
6262
Message::Text(s) => {
6363
if let Err(e) = handler(vec![Edn::List(vec![
64-
Edn::kwd("message"),
64+
Edn::tag("message"),
6565
Edn::Number(client_id as f64),
6666
Edn::Str(s.into_boxed_str()),
6767
])]) {
@@ -70,7 +70,7 @@ pub fn wss_serve(
7070
}
7171
Message::Binary(buf) => {
7272
if let Err(e) = handler(vec![Edn::List(vec![
73-
Edn::kwd("message"),
73+
Edn::tag("message"),
7474
Edn::Number(client_id as f64),
7575
Edn::Buffer(buf),
7676
])]) {

0 commit comments

Comments
 (0)