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 | 12 | [dependencies] |
| 13 | 13 | libc = "0.2.66" |
| 14 | 14 | futures = "0.3.1" |
| 15 | | url = "2.1.0" |
| 16 | | tokio = "0.2.0-alpha.6" |
| 17 | | async-std = { version = "1.2.0", features = [ "unstable" ] } |
| 18 | | async-task = { git = "https://github.com/async-rs/async-task/" } |
| 15 | url = "2.1.1" |
| 16 | tokio = { version = "0.2.9", features = [ "rt-threaded" ] } |
| 17 | async-std = { version = "1.4.0", features = [ "unstable" ] } |
| 18 | async-task = "1.2.1" |
| 19 | 19 | pipe-channel = "1.2.2" |
| 20 | 20 | clap = "2.33.0" |
| 21 | 21 | |
src/config.rs
+2 −2
| @@ -1,12 +1,12 @@ |
| 1 | 1 | use crate::PLUGIN_NAME; |
| 2 | 2 | use weechat::Weechat; |
| 3 | 3 | |
| 4 | | pub struct Config(weechat::Config); |
| 4 | pub struct Config(weechat::config::Config); |
| 5 | 5 | |
| 6 | 6 | impl Config { |
| 7 | 7 | pub fn new(weechat: &Weechat) -> Config { |
| 8 | 8 | let config = weechat |
| 9 | | .config_new(PLUGIN_NAME, || {}) |
| 9 | .config_new(PLUGIN_NAME, |_, _| {}) |
| 10 | 10 | .expect("Can't create new config"); |
| 11 | 11 | |
| 12 | 12 | Config(config) |
src/server.rs
+5 −2
| @@ -4,6 +4,7 @@ use async_task::JoinHandle; |
| 4 | 4 | use std::collections::HashMap; |
| 5 | 5 | use std::sync::Arc; |
| 6 | 6 | use std::time::Duration; |
| 7 | use tokio::runtime; |
| 7 | 8 | use tokio::runtime::Runtime; |
| 8 | 9 | use url::Url; |
| 9 | 10 | |
| @@ -102,7 +103,10 @@ impl MatrixServer { |
| 102 | 103 | } |
| 103 | 104 | |
| 104 | 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 | 111 | let send_client = self.client.clone(); |
| 108 | 112 | let (tx, rx) = async_channel(1000); |
| @@ -123,7 +127,6 @@ impl MatrixServer { |
| 123 | 127 | pub fn disconnect(&mut self) { |
| 124 | 128 | let connected_state = self.connected_state.take(); |
| 125 | 129 | if let Some(s) = connected_state { |
| 126 | | s.runtime.shutdown_now(); |
| 127 | 130 | s.sync_receiver.cancel(); |
| 128 | 131 | } |
| 129 | 132 | } |