From 0c2ee2b3784c65578d966c291931f5c9fac35691 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Wed, 2 Apr 2014 22:56:23 +0200 Subject: [PATCH] Automated fixes to follow Rust development Applied fixes: *priv attribute removal *attribute fix (cf mozilla/rust#2569) *Rename Port to Receiver (cf mozilla/rust@78580651131c9daacd7e5e4669af819cdd719f09) *logging macros need the log crate --- src/statsd/client.rs | 4 ++-- src/statsd/lib.rs | 8 ++++---- src/statsd/server/main.rs | 5 ++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/statsd/client.rs b/src/statsd/client.rs index 661ce4d..29c7952 100644 --- a/src/statsd/client.rs +++ b/src/statsd/client.rs @@ -14,8 +14,8 @@ data and timing a function call). Most work is handled by the server. **TODO**: allow prefixing keys. */ pub struct Client { - priv dest: SocketAddr, - priv sock: UdpSocket + dest: SocketAddr, + sock: UdpSocket } diff --git a/src/statsd/lib.rs b/src/statsd/lib.rs index fd717c8..730da2b 100644 --- a/src/statsd/lib.rs +++ b/src/statsd/lib.rs @@ -8,10 +8,10 @@ will be received by the server, and there is (by design) no indication of this. */ -#[comment = "statsd implementation"]; -#[license = "MIT"]; -#[crate_type = "lib"]; -#[crate_id = "statsd#0.0.0"]; +#![comment = "statsd implementation"] +#![license = "MIT"] +#![crate_type = "lib"] +#![crate_id = "statsd#0.0.0"] extern crate test; extern crate time; diff --git a/src/statsd/server/main.rs b/src/statsd/server/main.rs index cb67244..0663bcd 100644 --- a/src/statsd/server/main.rs +++ b/src/statsd/server/main.rs @@ -1,3 +1,6 @@ +#![feature(phase)] +#[phase(syntax, link)] +extern crate log; extern crate std; extern crate test; extern crate sync; @@ -118,7 +121,7 @@ fn print_usage() { println!("Usage: {} [options]", os::args()[0]); println!(" -h --help Show usage information"); println!(" --graphite host[:port] Enable the graphite backend. \ -Port will default to 2003 if not specified."); +Receiver will default to 2003 if not specified."); println!(" --console Enable console output."); println!(" --port port Have the statsd server listen on this \ UDP port. Defaults to {}.", DEFAULT_UDP_PORT);