Skip to content

linkerd2-proxy: Adopt Rust 2018#302

Merged
olix0r merged 5 commits intomasterfrom
ver/edition-2018
Aug 8, 2019
Merged

linkerd2-proxy: Adopt Rust 2018#302
olix0r merged 5 commits intomasterfrom
ver/edition-2018

Conversation

@olix0r
Copy link
Member

@olix0r olix0r commented Aug 8, 2019

Much of this repo was moved to Rust 2018 in 1d4eac..011c00. This
change updates the primary proxy project.

More information about Rust 2018 can be found at
https://doc.rust-lang.org/stable/edition-guide/rust-2018/edition-changes.html

While pursuing this change, I've tried to consolidate use statements into a
single block at the beginning of each module. This will help to make modules
more uniform.

There are no functional changes.

Much of this repo was moved to Rust 2018 in 1d4eac..011c00. This
change updates the primary proxy project.

More information about Rust 2018 can be found at
https://doc.rust-lang.org/stable/edition-guide/rust-2018/edition-changes.html
@olix0r olix0r requested review from adleong, hawkw and kleimkuhler August 8, 2019 15:06
@olix0r olix0r self-assigned this Aug 8, 2019
Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up I had to make the following changes to get this to build:

diff --git a/src/telemetry/process.rs b/src/telemetry/process.rs
index e3c8bdd..dcbc69e 100644
--- a/src/telemetry/process.rs
+++ b/src/telemetry/process.rs
@@ -2,7 +2,7 @@ use self::system::System;
 use linkerd2_metrics::{metrics, FmtMetrics, Gauge};
 use std::fmt;
 use std::time::{SystemTime, UNIX_EPOCH};
-use tracing::{debug, error, warn};
+use tracing::debug;
 
 metrics! {
     process_start_time_seconds: Gauge {
@@ -169,7 +169,7 @@ mod system {
 mod system {
     use std::{fmt, io};
 
-    use super::super::metrics::FmtMetrics;
+    use super::FmtMetrics;
 
     #[derive(Clone, Debug)]
     pub(super) struct System {}
diff --git a/src/transport/addr_info.rs b/src/transport/addr_info.rs
index a20e69e..274b732 100644
--- a/src/transport/addr_info.rs
+++ b/src/transport/addr_info.rs
@@ -2,7 +2,7 @@ use std::fmt::Debug;
 use std::io;
 use std::net::SocketAddr;
 use tokio::net::TcpStream;
-use tracing::trace;
+use tracing::{debug, trace};
 
 pub trait AddrInfo: Debug {
     fn local_addr(&self) -> Result<SocketAddr, io::Error>;

Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this change. Commented on some possible style nits that don't actually matter to me.

@olix0r
Copy link
Member Author

olix0r commented Aug 8, 2019

@kleimkuhler thanks, i had only tested compiling on linux. should work on macos now, as well.

Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@olix0r olix0r merged commit fa6c5bd into master Aug 8, 2019
@olix0r olix0r deleted the ver/edition-2018 branch August 8, 2019 23:26
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Aug 9, 2019
* Update h2 to v0.1.26
* Properly fall back in the dst_router (linkerd/linkerd2-proxy#291)
* Tap server authorizes clients when identity is expected (linkerd/linkerd2-proxy#290)
* update-rust-version: Check usage (linkerd/linkerd2-proxy#298)
* tap: fix tap response streams never ending (linkerd/linkerd2-proxy#299)
* Require identity on tap requests (linkerd/linkerd2-proxy#295)
* Authority label should reflect logical dst (linkerd/linkerd2-proxy#300)
* Replace futures_watch with tokio::sync::watch (linkerd/linkerd2-proxy#301)
* metrics: add `request_handle_us` histogram (linkerd/linkerd2-proxy#294)
* linkerd2-proxy: Adopt Rust 2018 (linkerd/linkerd2-proxy#302)
* Remove futures-mpsc-lossy (linkerd/linkerd2-proxy#305)
* Adopt std::convert::TryFrom (linkerd/linkerd2-proxy#304)
* lib: Rename directories to match crate names (linkerd/linkerd2-proxy#303)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Aug 9, 2019
* update-rust-version: Check usage (linkerd/linkerd2-proxy#298)
* tap: fix tap response streams never ending (linkerd/linkerd2-proxy#299)
* Require identity on tap requests (linkerd/linkerd2-proxy#295)
* Authority label should reflect logical dst (linkerd/linkerd2-proxy#300)
* Replace futures_watch with tokio::sync::watch (linkerd/linkerd2-proxy#301)
* metrics: add `request_handle_us` histogram (linkerd/linkerd2-proxy#294)
* linkerd2-proxy: Adopt Rust 2018 (linkerd/linkerd2-proxy#302)
* Remove futures-mpsc-lossy (linkerd/linkerd2-proxy#305)
* Adopt std::convert::TryFrom (linkerd/linkerd2-proxy#304)
* lib: Rename directories to match crate names (linkerd/linkerd2-proxy#303)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Aug 9, 2019
* update-rust-version: Check usage (linkerd/linkerd2-proxy#298)
* tap: fix tap response streams never ending (linkerd/linkerd2-proxy#299)
* Require identity on tap requests (linkerd/linkerd2-proxy#295)
* Authority label should reflect logical dst (linkerd/linkerd2-proxy#300)
* Replace futures_watch with tokio::sync::watch (linkerd/linkerd2-proxy#301)
* metrics: add `request_handle_us` histogram (linkerd/linkerd2-proxy#294)
* linkerd2-proxy: Adopt Rust 2018 (linkerd/linkerd2-proxy#302)
* Remove futures-mpsc-lossy (linkerd/linkerd2-proxy#305)
* Adopt std::convert::TryFrom (linkerd/linkerd2-proxy#304)
* lib: Rename directories to match crate names (linkerd/linkerd2-proxy#303)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants