Skip to content

Commit b668f32

Browse files
committed
Fix some smaller compilation issues with rust-1.22
Signed-off-by: Fabian Deutsch <[email protected]>
1 parent b885b26 commit b668f32

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/server.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::borrow::Cow;
88
use bytes::BytesMut;
99
use bytes::BufMut;
1010

11-
use futures::{future, Future, BoxFuture};
11+
use futures::{future, Future};
1212

1313
use tokio_proto::pipeline::ServerProto;
1414
use tokio_service::Service;
@@ -40,7 +40,7 @@ pub struct Error {
4040
}
4141

4242
impl From<serde_json::Error> for Error {
43-
fn from(e: serde_json::Error) -> Self {
43+
fn from(_e: serde_json::Error) -> Self {
4444
Error {
4545
error: "UnknownError".into(),
4646
..Default::default()
@@ -177,19 +177,19 @@ impl Service for VarlinkService {
177177
type Error = io::Error;
178178

179179
// The future for computing the response; box it for simplicity.
180-
type Future = BoxFuture<Self::Response, Self::Error>;
180+
type Future = Box<Future<Item=Self::Response, Error=Self::Error> + Send>;
181181

182182
// Produce a future for computing a response from a request.
183183
fn call(&self, req: Self::Request) -> Self::Future {
184184

185185
println!("Request: {}", serde_json::to_string(&req).unwrap());
186186
let n: usize = match req.method.rfind('.') {
187187
None => {
188-
return future::ok(Response::Err(Error {
188+
return Box::new(future::ok(Response::Err(Error {
189189
error: "InterfaceNotFound".into(),
190190
parameters: Some(json!({"interface": req.method})),
191191
..Default::default()
192-
})).boxed()
192+
})))
193193
}
194194
Some(x) => x,
195195
};
@@ -199,24 +199,24 @@ impl Service for VarlinkService {
199199
match iface.as_ref() {
200200
"org.varlink.service" => {
201201
match self::Interface::call(self, req) {
202-
Ok(val) => future::ok(Response::Ok(Reply { parameters: Some(val) })).boxed(),
203-
Err(e) => future::ok(Response::Err(e)).boxed(),
202+
Ok(val) => Box::new(future::ok(Response::Ok(Reply { parameters: Some(val) }))),
203+
Err(e) => Box::new(future::ok(Response::Err(e)))
204204
}
205205
}
206206
key => {
207207
if self.ifaces.contains_key(key) {
208208
match self.ifaces[key].call(req) {
209209
Ok(val) => {
210-
future::ok(Response::Ok(Reply { parameters: Some(val) })).boxed()
210+
Box::new(future::ok(Response::Ok(Reply { parameters: Some(val) })))
211211
}
212-
Err(e) => future::ok(Response::Err(e)).boxed(),
212+
Err(e) => Box::new(future::ok(Response::Err(e))),
213213
}
214214
} else {
215-
future::ok(Response::Err(Error {
215+
Box::new(future::ok(Response::Err(Error {
216216
error: "InterfaceNotFound".into(),
217217
parameters: Some(json!({"interface": key})),
218218
..Default::default()
219-
})).boxed()
219+
})))
220220
}
221221
}
222222

0 commit comments

Comments
 (0)