Skip to content

Commit

Permalink
chore: cargo fix --edition
Browse files Browse the repository at this point in the history
to epoch 2018
  • Loading branch information
pjenvey committed Jan 7, 2019
1 parent 9244c7f commit 00592dd
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 55 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ authors = [
"Alex Crichton <[email protected]>",
"Phil Jenvey <[email protected]>",
]
edition = "2018"

[lib]
name = "autopush"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.29.1-stretch as builder
FROM rust:1.31.1-stretch as builder

ADD . /app
WORKDIR /app
Expand All @@ -8,7 +8,7 @@ RUN \
cargo --version && \
rustc --version && \
mkdir -m 755 bin && \
cargo install --root /app
cargo install --path . --root /app


FROM debian:stretch-slim
Expand Down
20 changes: 10 additions & 10 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use futures::sync::mpsc;
use futures::sync::oneshot::Receiver;
use futures::AsyncSink;
use futures::{Async, Future, Poll, Sink, Stream};
use reqwest::async::Client as AsyncClient;
use reqwest::r#async::Client as AsyncClient;
use rusoto_dynamodb::UpdateItemOutput;
use sentry;
use sentry::integrations::error_chain::event_from_error_chain;
Expand All @@ -26,12 +26,12 @@ use tokio_core::reactor::Timeout;
use uuid::Uuid;
use woothee::parser::Parser;

use db::{CheckStorageResponse, HelloResponse, RegisterResponse};
use errors::*;
use protocol::{ClientMessage, Notification, ServerMessage, ServerNotification};
use server::Server;
use util::megaphone::{Broadcast, BroadcastSubs};
use util::{ms_since_epoch, parse_user_agent, sec_since_epoch};
use crate::db::{CheckStorageResponse, HelloResponse, RegisterResponse};
use crate::errors::*;
use crate::protocol::{ClientMessage, Notification, ServerMessage, ServerNotification};
use crate::server::Server;
use crate::util::megaphone::{Broadcast, BroadcastSubs};
use crate::util::{ms_since_epoch, parse_user_agent, sec_since_epoch};

// Created and handed to the AutopushServer
pub struct RegisteredClient {
Expand Down Expand Up @@ -801,11 +801,11 @@ where
}

fn poll_await_input<'a>(
await: &'a mut RentToOwn<'a, AwaitInput<T>>,
r#await: &'a mut RentToOwn<'a, AwaitInput<T>>,
) -> Poll<AfterAwaitInput<T>, Error> {
trace!("State: AwaitInput");
let input = try_ready!(await.data.input_or_notif());
let AwaitInput { data } = await.take();
let input = try_ready!(r#await.data.input_or_notif());
let AwaitInput { data } = r#await.take();
let webpush_rc = data.webpush.clone();
let mut webpush = webpush_rc.borrow_mut();
match input {
Expand Down
6 changes: 3 additions & 3 deletions src/db/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use serde_dynamodb;
use super::models::{DynamoDbNotification, DynamoDbUser};
use super::util::generate_last_connect;
use super::{HelloResponse, MAX_EXPIRY, USER_RECORD_VERSION};
use errors::*;
use protocol::Notification;
use util::timing::sec_since_epoch;
use crate::errors::*;
use crate::protocol::Notification;
use crate::util::timing::sec_since_epoch;

#[derive(Default)]
pub struct FetchMessageResponse {
Expand Down
8 changes: 4 additions & 4 deletions src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ use serde_dynamodb;
mod macros;
mod commands;
mod models;
use errors::*;
use protocol::Notification;
use server::{Server, ServerOptions};
use crate::errors::*;
use crate::protocol::Notification;
use crate::server::{Server, ServerOptions};
mod util;
use util::timing::sec_since_epoch;
use crate::util::timing::sec_since_epoch;

use self::commands::FetchMessageResponse;
use self::models::{DynamoDbNotification, DynamoDbUser};
Expand Down
10 changes: 5 additions & 5 deletions src/db/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use uuid::Uuid;
use regex::RegexSet;
use serde::Serializer;

use db::util::generate_last_connect;
use errors::*;
use protocol::Notification;
use util::timing::{ms_since_epoch, sec_since_epoch};
use crate::db::util::generate_last_connect;
use crate::errors::*;
use crate::protocol::Notification;
use crate::util::timing::{ms_since_epoch, sec_since_epoch};

use super::{MAX_EXPIRY, USER_RECORD_VERSION};

Expand Down Expand Up @@ -241,7 +241,7 @@ struct RangeKey {
#[cfg(test)]
mod tests {
use super::DynamoDbNotification;
use util::us_since_epoch;
use crate::util::us_since_epoch;
use uuid::Uuid;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use serde_json;
use tokio_service::Service;
use uuid::Uuid;

use server::Server;
use crate::server::Server;

pub struct Push(pub Rc<Server>);

Expand Down
2 changes: 1 addition & 1 deletion src/logging.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::io;

use errors::Result;
use crate::errors::Result;

use mozsvc_common::{aws::get_ec2_instance_id, get_hostname};
use slog::{self, Drain};
Expand Down
2 changes: 1 addition & 1 deletion src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::str::FromStr;
use serde_json;
use uuid::Uuid;

use util::ms_since_epoch;
use crate::util::ms_since_epoch;

// Used for the server to flag a webpush client to deliver a Notification or Check storage
pub enum ServerNotification {
Expand Down
6 changes: 3 additions & 3 deletions src/server/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ use httparse;
use tokio_core::net::TcpStream;
use tokio_io::AsyncRead;

use errors::*;
use server::tls::MaybeTlsStream;
use server::webpush_io::WebpushIo;
use crate::errors::*;
use crate::server::tls::MaybeTlsStream;
use crate::server::webpush_io::WebpushIo;

pub struct Dispatch {
socket: Option<MaybeTlsStream<TcpStream>>,
Expand Down
4 changes: 2 additions & 2 deletions src/server/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::net::UdpSocket;

use cadence::{BufferedUdpMetricSink, NopMetricSink, QueuingMetricSink, StatsdClient};

use errors::*;
use server::ServerOptions;
use crate::errors::*;
use crate::server::ServerOptions;

/// Create a cadence StatsdClient from the given options
pub fn metrics_from_opts(opts: &ServerOptions) -> Result<StatsdClient> {
Expand Down
30 changes: 15 additions & 15 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ use tungstenite::handshake::server::Request;
use tungstenite::Message;
use uuid::Uuid;

use client::{Client, RegisteredClient};
use db::DynamoStorage;
use errors::*;
use errors::{Error, Result};
use http;
use logging;
use protocol::{BroadcastValue, ClientMessage, Notification, ServerMessage, ServerNotification};
use server::dispatch::{Dispatch, RequestType};
use server::metrics::metrics_from_opts;
use server::webpush_io::WebpushIo;
use settings::Settings;
use util::megaphone::{
use crate::client::{Client, RegisteredClient};
use crate::db::DynamoStorage;
use crate::errors::*;
use crate::errors::{Error, Result};
use crate::http;
use crate::logging;
use crate::protocol::{BroadcastValue, ClientMessage, Notification, ServerMessage, ServerNotification};
use crate::server::dispatch::{Dispatch, RequestType};
use crate::server::metrics::metrics_from_opts;
use crate::server::webpush_io::WebpushIo;
use crate::settings::Settings;
use crate::util::megaphone::{
Broadcast, BroadcastChangeTracker, BroadcastSubs, BroadcastSubsInit, MegaphoneAPIResponse,
};
use util::{timeout, RcObject};
use crate::util::{timeout, RcObject};

mod dispatch;
mod metrics;
Expand Down Expand Up @@ -574,7 +574,7 @@ struct MegaphoneUpdater {
state: MegaphoneState,
timeout: Timeout,
poll_interval: Duration,
client: reqwest::async::Client,
client: reqwest::r#async::Client,
}

impl MegaphoneUpdater {
Expand All @@ -584,7 +584,7 @@ impl MegaphoneUpdater {
poll_interval: Duration,
srv: &Rc<Server>,
) -> io::Result<MegaphoneUpdater> {
let client = reqwest::async::Client::builder()
let client = reqwest::r#async::Client::builder()
.timeout(Duration::from_secs(1))
.build()
.expect("Unable to build reqwest client");
Expand Down
4 changes: 2 additions & 2 deletions src/server/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use tokio_core::net::TcpStream;
use tokio_io::{AsyncRead, AsyncWrite};
use tokio_openssl::{SslAcceptorExt, SslStream};

use errors::*;
use server::{Server, ServerOptions};
use crate::errors::*;
use crate::server::{Server, ServerOptions};

/// Creates an `SslAcceptor`, if needed, ready to accept TLS connections.
///
Expand Down
2 changes: 1 addition & 1 deletion src/server/webpush_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use futures::Poll;
use tokio_core::net::TcpStream;
use tokio_io::{AsyncRead, AsyncWrite};

use server::tls::MaybeTlsStream;
use crate::server::tls::MaybeTlsStream;

pub struct WebpushIo {
tcp: MaybeTlsStream<TcpStream>,
Expand Down
4 changes: 2 additions & 2 deletions src/util/megaphone.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use errors::Result;
use crate::errors::Result;
use std::collections::HashMap;
use std::time::Duration;

use protocol::BroadcastValue;
use crate::protocol::BroadcastValue;

use reqwest;

Expand Down
2 changes: 1 addition & 1 deletion src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::time::Duration;
use futures::future::{Either, Future, IntoFuture};
use tokio_core::reactor::{Handle, Timeout};

use errors::*;
use crate::errors::*;

pub mod megaphone;
mod rc;
Expand Down
4 changes: 2 additions & 2 deletions src/util/send_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ where

fn try_start_send(&mut self, item: T::Item) -> Poll<(), U::SinkError> {
debug_assert!(self.buffered.is_none());
if let AsyncSink::NotReady(item) = try!(self.sink_mut().start_send(item)) {
if let AsyncSink::NotReady(item) = r#try!(self.sink_mut().start_send(item)) {
self.buffered = Some(item);
return Ok(Async::NotReady);
}
Expand All @@ -77,7 +77,7 @@ where
}

loop {
match try!(self.stream_mut().poll()) {
match r#try!(self.stream_mut().poll()) {
Async::Ready(Some(item)) => try_ready!(self.try_start_send(item)),
Async::Ready(None) => {
try_ready!(self.sink_mut().poll_complete());
Expand Down

0 comments on commit 00592dd

Please sign in to comment.