Update dependencies (#18)

* update dependencies

* tonic-examples: Lock -> Mutex
This commit is contained in:
Juan Alvarez
2019-10-01 15:04:07 -04:00
committed by Lucio Franco
parent 02d14da3d6
commit d275785c55
5 changed files with 29 additions and 31 deletions
+4 -4
View File
@@ -50,11 +50,11 @@ bytes = "0.4"
prost = "0.5"
prost-derive = "0.5"
tokio = "=0.2.0-alpha.4"
futures-preview = { version = "=0.3.0-alpha.18", default-features = false, features = ["alloc"]}
async-stream = "0.1.1"
tokio = "=0.2.0-alpha.6"
futures-preview = { version = "=0.3.0-alpha.19", default-features = false, features = ["alloc"]}
async-stream = "0.1.2"
http = "0.1"
tower = "0.3.0-alpha.1a"
tower = "0.3.0-alpha.2"
# Required for routeguide
serde = { version = "1.0", features = ["derive"] }
+3 -3
View File
@@ -6,7 +6,7 @@ use std::hash::{Hash, Hasher};
use std::pin::Pin;
use std::sync::Arc;
use std::time::Instant;
use tokio::sync::{mpsc, Lock};
use tokio::sync::{mpsc, Mutex};
use tonic::transport::Server;
use tonic::{Request, Response, Status};
@@ -24,7 +24,7 @@ pub struct RouteGuide {
#[derive(Debug, Clone)]
struct State {
features: Arc<Vec<Feature>>,
notes: Lock<HashMap<Point, Vec<RouteNote>>>,
notes: Arc<Mutex<HashMap<Point, Vec<RouteNote>>>>,
}
#[tonic::async_trait]
@@ -161,7 +161,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
state: State {
// Load data file
features: Arc::new(data::load()),
notes: Lock::new(HashMap::new()),
notes: Arc::new(Mutex::new(HashMap::new())),
},
};