Skip to content

Commit 11f31b9

Browse files
committed
Fix formatting for tidy
1 parent 5311d59 commit 11f31b9

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

src/libextra/term.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ pub impl Terminal {
7575
}
7676

7777
let mut inf = ti.get();
78-
let cs = *inf.numbers.find_or_insert(~"colors", 0) >= 16 && inf.strings.find(&~"setaf").is_some()
78+
let cs = *inf.numbers.find_or_insert(~"colors", 0) >= 16
79+
&& inf.strings.find(&~"setaf").is_some()
7980
&& inf.strings.find_equiv(&("setab")).is_some();
8081

8182
return Ok(Terminal {out: out, ti: inf, color_supported: cs});

src/libextra/terminfo/parm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub enum Param {
4646
To be compatible with ncurses, `sta` and `dyn` should be the same between calls to `expand` for
4747
multiple capabilities for the same terminal.
4848
*/
49-
pub fn expand(cap: &[u8], params: &mut [Param], sta: &mut [Param], dyn: &mut [Param])
49+
pub fn expand(cap: &[u8], params: &mut [Param], sta: &mut [Param], dyn: &mut [Param])
5050
-> Result<~[u8], ~str> {
5151
assert!(cap.len() != 0, "expanding an empty capability makes no sense");
5252
assert!(params.len() <= 9, "only 9 parameters are supported by capability strings");

src/libextra/terminfo/parser/compiled.rs

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
/// ncurses-compatible compiled terminfo format parsing (term(5))
212
313
use core::prelude::*;
@@ -283,11 +293,12 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
283293

284294

285295
// Find the offset of the NUL we want to go to
286-
let nulpos = vec::position_between(string_table, offset as uint, string_table_bytes as uint,
287-
|&b| b == 0);
296+
let nulpos = vec::position_between(string_table, offset as uint,
297+
string_table_bytes as uint, |&b| b == 0);
288298
match nulpos {
289299
Some(x) => {
290-
string_map.insert(name.to_owned(), string_table.slice(offset as uint, x).to_owned())
300+
string_map.insert(name.to_owned(),
301+
string_table.slice(offset as uint, x).to_owned())
291302
},
292303
None => {
293304
return Err(~"invalid file: missing NUL in string_table");
@@ -303,7 +314,7 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
303314
#[cfg(test)]
304315
mod test {
305316
use super::*;
306-
use p = std::path::PosixPath;
317+
use p = std::path::Path;
307318

308319
#[test]
309320
fn test_veclens() {
@@ -314,6 +325,7 @@ mod test {
314325

315326
#[test]
316327
fn test_parse() {
317-
parse(io::file_reader(&p("/usr/share/terminfo/r/rxvt-256color")).unwrap(), false);
328+
// FIXME #6870: Distribute a compiled file in src/tests and test there
329+
// parse(io::file_reader(&p("/usr/share/terminfo/r/rxvt-256color")).unwrap(), false);
318330
}
319331
}

0 commit comments

Comments
 (0)