File tree Expand file tree Collapse file tree 4 files changed +15
-26
lines changed Expand file tree Collapse file tree 4 files changed +15
-26
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: ae76a7db5d5747aad7e572911848800e139f127b
2
+ refs/heads/master: f6ecbe88ca67769ccb9def337ada9ae25235e00e
Original file line number Diff line number Diff line change @@ -218,8 +218,8 @@ mod test {
218
218
#[ test]
219
219
fn test_prefix_rpath ( ) {
220
220
let res = get_install_prefix_rpath ( "/usr/lib" , "triple" ) ;
221
- assert str :: ends_with ( res , #env ( "CFG_PREFIX" )
222
- + "/lib/rustc/triple/lib" ) ;
221
+ let d = fs :: connect ( #env ( "CFG_PREFIX" ) , "/lib/rustc/triple/lib" ) ;
222
+ assert str :: ends_with ( res , d ) ;
223
223
}
224
224
225
225
#[ test]
Original file line number Diff line number Diff line change @@ -32,13 +32,6 @@ A signed integer with the same size as a C `long`
32
32
*/
33
33
type long = int;
34
34
35
- /*
36
- Type: longlong
37
-
38
- A signed integer with the same size as a C `long long`
39
- */
40
- type longlong = i64;
41
-
42
35
/*
43
36
Type: unsigned
44
37
@@ -53,13 +46,6 @@ An unsigned integer with the same size as a C `unsigned long`
53
46
*/
54
47
type ulong = uint;
55
48
56
- /*
57
- Type: ulonglong
58
-
59
- An unsigned integer with the same size as a C `unsigned long long`
60
- */
61
- type ulonglong = u64;
62
-
63
49
/*
64
50
Type: intptr_t
65
51
Original file line number Diff line number Diff line change @@ -81,17 +81,20 @@ Function: connect
81
81
82
82
Connects to path segments
83
83
84
- Given paths `pre` and `post` this function will return a path
85
- that is equal to `post` appended to `pre`, inserting a path separator
86
- between the two as needed .
84
+ Given paths `pre` and `post, removes any trailing path separator on `pre` and
85
+ any leading path separator on `post`, and returns the concatenation of the two
86
+ with a single path separator between them .
87
87
*/
88
- fn connect ( pre : path , post : path ) -> path {
89
- let len = str:: byte_len ( pre) ;
90
- ret if pre[ len - 1 u] == os_fs:: path_sep as u8 {
91
88
92
- // Trailing '/'?
93
- pre + post
94
- } else { pre + path_sep ( ) + post } ;
89
+ fn connect ( pre : path , post : path ) -> path {
90
+ let pre_ = pre;
91
+ let post_ = post;
92
+ let sep = os_fs:: path_sep as u8 ;
93
+ let pre_len = str:: byte_len ( pre) ;
94
+ let post_len = str:: byte_len ( post) ;
95
+ if pre_len > 1 u && pre[ pre_len-1 u] == sep { str:: pop_byte ( pre_) ; }
96
+ if post_len > 1 u && post[ 0 ] == sep { str:: shift_byte ( post_) ; }
97
+ ret pre_ + path_sep ( ) + post_;
95
98
}
96
99
97
100
/*
You can’t perform that action at this time.
0 commit comments