Skip to content

A couple minor cleanups #3278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 26, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/libstd/ebml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ enum ebml_serializer_tag {

trait serializer_priv {
fn _emit_tagged_uint(t: ebml_serializer_tag, v: uint);
fn _emit_label(label: ~str);
fn _emit_label(label: &str);
}

impl ebml::writer: serializer_priv {
Expand All @@ -330,7 +330,7 @@ impl ebml::writer: serializer_priv {
self.wr_tagged_u32(t as uint, v as u32);
}

fn _emit_label(label: ~str) {
fn _emit_label(label: &str) {
// There are various strings that we have access to, such as
// the name of a record field, which do not actually appear in
// the serialized EBML (normally). This is just for
Expand Down Expand Up @@ -365,11 +365,11 @@ impl ebml::writer: serialization::serializer {

fn emit_str(v: &str) { self.wr_tagged_str(es_str as uint, v) }

fn emit_enum(name: ~str, f: fn()) {
fn emit_enum(name: &str, f: fn()) {
self._emit_label(name);
self.wr_tag(es_enum as uint, f)
}
fn emit_enum_variant(_v_name: ~str, v_id: uint, _cnt: uint, f: fn()) {
fn emit_enum_variant(_v_name: &str, v_id: uint, _cnt: uint, f: fn()) {
self._emit_tagged_uint(es_enum_vid, v_id);
self.wr_tag(es_enum_body as uint, f)
}
Expand All @@ -389,7 +389,7 @@ impl ebml::writer: serialization::serializer {
fn emit_box(f: fn()) { f() }
fn emit_uniq(f: fn()) { f() }
fn emit_rec(f: fn()) { f() }
fn emit_rec_field(f_name: ~str, _f_idx: uint, f: fn()) {
fn emit_rec_field(f_name: &str, _f_idx: uint, f: fn()) {
self._emit_label(f_name);
f()
}
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net_tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn connect(-input_ip: ip::ip_addr, port: uint,
0i32 => {
log(debug, ~"tcp_init successful");
match input_ip {
ipv4 => {
_ipv4 => {
log(debug, ~"dealing w/ ipv4 connection..");
let connect_req_ptr =
ptr::addr_of((*socket_data_ptr).connect_req);
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/prettyprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ impl Writer: serializer {
self.write_str(fmt!("%?", v));
}

fn emit_enum(_name: ~str, f: fn()) {
fn emit_enum(_name: &str, f: fn()) {
f();
}

fn emit_enum_variant(v_name: ~str, _v_id: uint, sz: uint, f: fn()) {
fn emit_enum_variant(v_name: &str, _v_id: uint, sz: uint, f: fn()) {
self.write_str(v_name);
if sz > 0u { self.write_str(~"("); }
f();
Expand Down Expand Up @@ -110,7 +110,7 @@ impl Writer: serializer {
self.write_str(~"}");
}

fn emit_rec_field(f_name: ~str, f_idx: uint, f: fn()) {
fn emit_rec_field(f_name: &str, f_idx: uint, f: fn()) {
if f_idx > 0u { self.write_str(~", "); }
self.write_str(f_name);
self.write_str(~": ");
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ trait serializer {
fn emit_str(v: &str);

// Compound types:
fn emit_enum(name: ~str, f: fn());
fn emit_enum_variant(v_name: ~str, v_id: uint, sz: uint, f: fn());
fn emit_enum(name: &str, f: fn());
fn emit_enum_variant(v_name: &str, v_id: uint, sz: uint, f: fn());
fn emit_enum_variant_arg(idx: uint, f: fn());
fn emit_vec(len: uint, f: fn());
fn emit_vec_elt(idx: uint, f: fn());
fn emit_box(f: fn());
fn emit_uniq(f: fn());
fn emit_rec(f: fn());
fn emit_rec_field(f_name: ~str, f_idx: uint, f: fn());
fn emit_rec_field(f_name: &str, f_idx: uint, f: fn());
fn emit_tup(sz: uint, f: fn());
fn emit_tup_elt(idx: uint, f: fn());
}
Expand Down