Skip to content

Commit 7a38ba9

Browse files
committed
Rust update: extern crate debug and more deprecated to_lower and to_upper
1 parent abf24bb commit 7a38ba9

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

src/codegen/branchify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn branchify(options: &[(&str, &str)], case_sensitive: bool) -> Vec<ParseBra
2727
fn go_down_moses(branch: &mut ParseBranch, mut chariter: Chars, result: &str, case_sensitive: bool) {
2828
match chariter.next() {
2929
Some(c) => {
30-
let first_case = if case_sensitive { c as u8 } else { c.to_ascii().to_upper().to_byte() };
30+
let first_case = if case_sensitive { c as u8 } else { c.to_ascii().to_uppercase().to_byte() };
3131
for next_branch in branch.children.mut_iter() {
3232
if *next_branch.matches.get(0) == first_case {
3333
go_down_moses(next_branch, chariter, result, case_sensitive);
@@ -37,7 +37,7 @@ pub fn branchify(options: &[(&str, &str)], case_sensitive: bool) -> Vec<ParseBra
3737
let mut subbranch = ParseBranch::new();
3838
subbranch.matches.push(first_case);
3939
if !case_sensitive {
40-
let second_case = c.to_ascii().to_lower().to_byte();
40+
let second_case = c.to_ascii().to_lowercase().to_byte();
4141
if first_case != second_case {
4242
subbranch.matches.push(second_case);
4343
}

src/codegen/status.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ fn camel_case(msg: &str) -> String {
5555
let mut capitalise = true;
5656
for c in msg.as_slice().chars() {
5757
let c = match capitalise {
58-
true => c.to_ascii().to_upper().to_char(),
59-
false => c.to_ascii().to_lower().to_char(),
58+
true => c.to_ascii().to_uppercase().to_char(),
59+
false => c.to_ascii().to_lowercase().to_char(),
6060
};
6161
// For a space, capitalise the next char
6262
capitalise = c == ' ';

src/examples/client/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![crate_id = "client"]
22

3+
extern crate debug;
34
extern crate http;
45
use http::client::RequestWriter;
56
use http::method::Get;

src/examples/server/info/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![crate_id = "info"]
55

66
extern crate time;
7+
extern crate debug;
78
extern crate http;
89

910
use std::io::net::ip::{SocketAddr, Ipv4Addr};

src/http/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
extern crate url;
2020
extern crate time;
2121
extern crate collections;
22+
extern crate debug;
2223

2324
pub mod buffer;
2425
pub mod client;

0 commit comments

Comments
 (0)