Skip to content

Commit cc046be

Browse files
committed
---
yaml --- r: 34943 b: refs/heads/master c: 1afa299 h: refs/heads/master i: 34941: 936b845 34939: 2a82f06 34935: f1dba7b 34927: fb217a3 34911: 28a5423 34879: 9d87f56 34815: e3ac160 v: v3
1 parent 962f5fd commit cc046be

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9ed8ce33646e0253fda91471fe528d1800bdf70c
2+
refs/heads/master: 1afa29986fe62cf817e886412dfb6d42b2d5f7e5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/libcore/rl.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,43 @@ extern mod linenoise {
1717

1818
/// Add a line to history
1919
pub fn add_history(line: ~str) -> bool {
20-
do str::as_c_str(line) |buf| {
21-
linenoise::linenoiseHistoryAdd(buf) == 1 as c_int
22-
}
20+
do str::as_c_str(line) |buf| {
21+
linenoise::linenoiseHistoryAdd(buf) == 1 as c_int
22+
}
2323
}
2424

2525
/// Set the maximum amount of lines stored
2626
pub fn set_history_max_len(len: int) -> bool {
27-
linenoise::linenoiseHistorySetMaxLen(len as c_int) == 1 as c_int
27+
linenoise::linenoiseHistorySetMaxLen(len as c_int) == 1 as c_int
2828
}
2929

3030
/// Save line history to a file
3131
pub fn save_history(file: ~str) -> bool {
32-
do str::as_c_str(file) |buf| {
33-
linenoise::linenoiseHistorySave(buf) == 1 as c_int
34-
}
32+
do str::as_c_str(file) |buf| {
33+
linenoise::linenoiseHistorySave(buf) == 1 as c_int
34+
}
3535
}
3636

3737
/// Load line history from a file
3838
pub fn load_history(file: ~str) -> bool {
39-
do str::as_c_str(file) |buf| {
40-
linenoise::linenoiseHistoryLoad(buf) == 1 as c_int
41-
}
39+
do str::as_c_str(file) |buf| {
40+
linenoise::linenoiseHistoryLoad(buf) == 1 as c_int
41+
}
4242
}
4343

4444
/// Print out a prompt and then wait for input and return it
4545
pub fn read(prompt: ~str) -> Option<~str> {
46-
do str::as_c_str(prompt) |buf| unsafe {
47-
let line = linenoise::linenoise(buf);
46+
do str::as_c_str(prompt) |buf| unsafe {
47+
let line = linenoise::linenoise(buf);
4848

49-
if line.is_null() { None }
50-
else { Some(str::raw::from_c_str(line)) }
51-
}
49+
if line.is_null() { None }
50+
else { Some(str::raw::from_c_str(line)) }
51+
}
5252
}
5353

5454
/// Clear the screen
5555
pub fn clear() {
56-
linenoise::linenoiseClearScreen();
56+
linenoise::linenoiseClearScreen();
5757
}
5858

5959
pub type CompletionCb = fn~(~str, fn(~str));
@@ -62,17 +62,17 @@ fn complete_key(_v: @CompletionCb) {}
6262

6363
/// Bind to the main completion callback
6464
pub fn complete(cb: CompletionCb) unsafe {
65-
task::local_data::local_data_set(complete_key, @(move cb));
65+
task::local_data::local_data_set(complete_key, @(move cb));
6666

67-
extern fn callback(line: *c_char, completions: *()) unsafe {
68-
let cb: CompletionCb = copy *task::local_data::local_data_get(complete_key).get();
67+
extern fn callback(line: *c_char, completions: *()) unsafe {
68+
let cb = copy *task::local_data::local_data_get(complete_key).get();
6969

70-
do cb(str::raw::from_c_str(line)) |suggestion| {
71-
do str::as_c_str(suggestion) |buf| {
72-
linenoise::linenoiseAddCompletion(completions, buf);
73-
}
74-
}
75-
}
70+
do cb(str::raw::from_c_str(line)) |suggestion| {
71+
do str::as_c_str(suggestion) |buf| {
72+
linenoise::linenoiseAddCompletion(completions, buf);
73+
}
74+
}
75+
}
7676

77-
linenoise::linenoiseSetCompletionCallback(callback);
77+
linenoise::linenoiseSetCompletionCallback(callback);
7878
}

trunk/src/rusti/rusti.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn run_cmd(repl: &mut Repl, _in: io::Reader, _out: io::Writer,
246246
rl::clear();
247247
}
248248
~"help" => {
249-
io::println(~":clear - clear the screen\n" +
249+
io::println(~":clear - clear the screen\n" +
250250
~":exit - exit from the repl\n" +
251251
~":help - show this message");
252252
}
@@ -294,7 +294,7 @@ fn main() {
294294
if line.starts_with(~":") {
295295
let full = line.substr(1, line.len() - 1);
296296
let split = full.split_char(' ');
297-
let len = split.len();
297+
let len = split.len();
298298

299299
if len > 0 {
300300
let cmd = split[0];

0 commit comments

Comments
 (0)