File tree Expand file tree Collapse file tree 5 files changed +120
-93
lines changed Expand file tree Collapse file tree 5 files changed +120
-93
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,12 @@ impl<T: Writer> Terminal<T> {
126
126
/// Returns `Err()` on failure to open the terminfo database correctly.
127
127
/// Also, in the event that the individual terminfo database entry can not
128
128
/// be parsed.
129
- pub fn new ( out : T ) -> Result < Terminal < T > , ~ str > {
129
+ pub fn new ( out : T ) -> Result < Terminal < T > , StrBuf > {
130
130
let term = match os:: getenv ( "TERM" ) {
131
131
Some ( t) => t,
132
- None => return Err ( "TERM environment variable undefined" . to_owned ( ) )
132
+ None => {
133
+ return Err ( "TERM environment variable undefined" . to_strbuf ( ) )
134
+ }
133
135
} ;
134
136
135
137
let mut file = match open ( term) {
@@ -251,7 +253,8 @@ impl<T: Writer> Terminal<T> {
251
253
cap = self . ti . strings . find_equiv ( & ( "op" ) ) ;
252
254
}
253
255
}
254
- let s = cap. map_or ( Err ( "can't find terminfo capability `sgr0`" . to_owned ( ) ) , |op| {
256
+ let s = cap. map_or ( Err ( "can't find terminfo capability \
257
+ `sgr0`". to_strbuf ( ) ) , |op| {
255
258
expand ( op. as_slice ( ) , [ ] , & mut Variables :: new ( ) )
256
259
} ) ;
257
260
if s. is_ok ( ) {
Original file line number Diff line number Diff line change @@ -15,13 +15,13 @@ use collections::HashMap;
15
15
/// A parsed terminfo database entry.
16
16
pub struct TermInfo {
17
17
/// Names for the terminal
18
- pub names : Vec < ~ str > ,
18
+ pub names : Vec < StrBuf > ,
19
19
/// Map of capability name to boolean value
20
- pub bools : HashMap < ~ str , bool > ,
20
+ pub bools : HashMap < StrBuf , bool > ,
21
21
/// Map of capability name to numeric value
22
- pub numbers : HashMap < ~ str , u16 > ,
22
+ pub numbers : HashMap < StrBuf , u16 > ,
23
23
/// Map of capability name to raw (unexpanded) string
24
- pub strings : HashMap < ~ str , Vec < u8 > >
24
+ pub strings : HashMap < StrBuf , Vec < u8 > >
25
25
}
26
26
27
27
pub mod searcher;
You can’t perform that action at this time.
0 commit comments