Commit a67ad42e15
a67ad42e15d27546a73bef80a1049031245f6eb0
parent: 9a1ee26769
Unsigned
Damir Jelić <poljar@termina.org.uk> · 2020-01-11 12:21 UTC
Upgrade the deps.
Layout: unified · split
Cargo.toml
+4 −4
| @@ -12,10 +12,10 @@ crate-type = ["dylib"] |
| 12 | [dependencies] |
12 | [dependencies] |
| 13 | libc = "0.2.66" |
13 | libc = "0.2.66" |
| 14 | futures = "0.3.1" |
14 | futures = "0.3.1" |
| 15 | url = "2.1.0" |
15 | url = "2.1.1" |
| 16 | tokio = "0.2.0-alpha.6" |
16 | tokio = { version = "0.2.9", features = [ "rt-threaded" ] } |
| 17 | async-std = { version = "1.2.0", features = [ "unstable" ] } |
17 | async-std = { version = "1.4.0", features = [ "unstable" ] } |
| 18 | async-task = { git = "https://github.com/async-rs/async-task/" } |
18 | async-task = "1.2.1" |
| 19 | pipe-channel = "1.2.2" |
19 | pipe-channel = "1.2.2" |
| 20 | clap = "2.33.0" |
20 | clap = "2.33.0" |
| 21 | |
21 | |
src/config.rs
+2 −2
| @@ -1,12 +1,12 @@ |
| 1 | use crate::PLUGIN_NAME; |
1 | use crate::PLUGIN_NAME; |
| 2 | use weechat::Weechat; |
2 | use weechat::Weechat; |
| 3 | |
3 | |
| 4 | pub struct Config(weechat::Config); |
4 | pub struct Config(weechat::config::Config); |
| 5 | |
5 | |
| 6 | impl Config { |
6 | impl Config { |
| 7 | pub fn new(weechat: &Weechat) -> Config { |
7 | pub fn new(weechat: &Weechat) -> Config { |
| 8 | let config = weechat |
8 | let config = weechat |
| 9 | .config_new(PLUGIN_NAME, || {}) |
9 | .config_new(PLUGIN_NAME, |_, _| {}) |
| 10 | .expect("Can't create new config"); |
10 | .expect("Can't create new config"); |
| 11 | |
11 | |
| 12 | Config(config) |
12 | Config(config) |
src/server.rs
+5 −2
| @@ -4,6 +4,7 @@ use async_task::JoinHandle; |
| 4 | use std::collections::HashMap; |
4 | use std::collections::HashMap; |
| 5 | use std::sync::Arc; |
5 | use std::sync::Arc; |
| 6 | use std::time::Duration; |
6 | use std::time::Duration; |
| |
7 | use tokio::runtime; |
| 7 | use tokio::runtime::Runtime; |
8 | use tokio::runtime::Runtime; |
| 8 | use url::Url; |
9 | use url::Url; |
| 9 | |
10 | |
| @@ -102,7 +103,10 @@ impl MatrixServer { |
| 102 | } |
103 | } |
| 103 | |
104 | |
| 104 | pub fn connect(&mut self) { |
105 | pub fn connect(&mut self) { |
| 105 | let runtime = Runtime::new().unwrap(); |
106 | let runtime = runtime::Builder::new() |
| |
107 | .threaded_scheduler() |
| |
108 | .build() |
| |
109 | .unwrap(); |
| 106 | |
110 | |
| 107 | let send_client = self.client.clone(); |
111 | let send_client = self.client.clone(); |
| 108 | let (tx, rx) = async_channel(1000); |
112 | let (tx, rx) = async_channel(1000); |
| @@ -123,7 +127,6 @@ impl MatrixServer { |
| 123 | pub fn disconnect(&mut self) { |
127 | pub fn disconnect(&mut self) { |
| 124 | let connected_state = self.connected_state.take(); |
128 | let connected_state = self.connected_state.take(); |
| 125 | if let Some(s) = connected_state { |
129 | if let Some(s) = connected_state { |
| 126 | s.runtime.shutdown_now(); |
| |
| 127 | s.sync_receiver.cancel(); |
130 | s.sync_receiver.cancel(); |
| 128 | } |
131 | } |
| 129 | } |
132 | } |