From 33167f7decfdc70c9dca6c41f80883f12c13cfbc Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 10 Oct 2011 13:54:03 +0200 Subject: Adjust function signatures to allow for vecs being immediate Some code was relying on vectors being implicitly by-reference (as non-immediate value). This adds the necessary &&-sigils. Closes #1021 --- src/comp/metadata/common.rs | 2 +- src/comp/metadata/encoder.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/comp/metadata') diff --git a/src/comp/metadata/common.rs b/src/comp/metadata/common.rs index 134e43d6280..fdb2d72da6f 100644 --- a/src/comp/metadata/common.rs +++ b/src/comp/metadata/common.rs @@ -67,7 +67,7 @@ const tag_items_data_item_inlineness: uint = 0x27u; // djb's cdb hashes. fn hash_node_id(&&node_id: int) -> uint { ret 177573u ^ (node_id as uint); } -fn hash_path(s: str) -> uint { +fn hash_path(&&s: str) -> uint { let h = 5381u; for ch: u8 in str::bytes(s) { h = (h << 5u) + h ^ (ch as uint); } ret h; diff --git a/src/comp/metadata/encoder.rs b/src/comp/metadata/encoder.rs index f8145c306c8..7850b4139a1 100644 --- a/src/comp/metadata/encoder.rs +++ b/src/comp/metadata/encoder.rs @@ -425,7 +425,7 @@ fn encode_index(ebml_w: ebml::writer, buckets: [@[entry]], ebml::end_tag(ebml_w); } -fn write_str(writer: io::writer, s: str) { writer.write_str(s); } +fn write_str(writer: io::writer, &&s: str) { writer.write_str(s); } fn write_int(writer: io::writer, &&n: int) { writer.write_be_uint(n as uint, 4u); -- cgit 1.4.1-3-g733a5