1
1
#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
2
2
3
- use std:: env;
4
-
5
3
/// This macro creates the version string during compilation from the
6
4
/// current environment
7
5
#[ macro_export]
@@ -121,7 +119,7 @@ pub fn get_commit_date() -> Option<String> {
121
119
122
120
#[ must_use]
123
121
pub fn get_channel ( ) -> String {
124
- match env:: var ( "CFG_RELEASE_CHANNEL" ) {
122
+ match std :: env:: var ( "CFG_RELEASE_CHANNEL" ) {
125
123
Ok ( channel) => channel,
126
124
Err ( _) => {
127
125
// if that failed, try to ask rustc -V, do some parsing and find out
@@ -156,8 +154,8 @@ mod test {
156
154
fn test_struct_local ( ) {
157
155
let vi = get_version_info ! ( ) ;
158
156
assert_eq ! ( vi. major, 0 ) ;
159
- assert_eq ! ( vi. minor, 2 ) ;
160
- assert_eq ! ( vi. patch, 1 ) ;
157
+ assert_eq ! ( vi. minor, 3 ) ;
158
+ assert_eq ! ( vi. patch, 0 ) ;
161
159
assert_eq ! ( vi. crate_name, "rustc_tools_util" ) ;
162
160
// hard to make positive tests for these since they will always change
163
161
assert ! ( vi. commit_hash. is_none( ) ) ;
@@ -167,7 +165,7 @@ mod test {
167
165
#[ test]
168
166
fn test_display_local ( ) {
169
167
let vi = get_version_info ! ( ) ;
170
- assert_eq ! ( vi. to_string( ) , "rustc_tools_util 0.2.1 " ) ;
168
+ assert_eq ! ( vi. to_string( ) , "rustc_tools_util 0.3.0 " ) ;
171
169
}
172
170
173
171
#[ test]
@@ -176,7 +174,7 @@ mod test {
176
174
let s = format ! ( "{vi:?}" ) ;
177
175
assert_eq ! (
178
176
s,
179
- "VersionInfo { crate_name: \" rustc_tools_util\" , major: 0, minor: 2 , patch: 1 }"
177
+ "VersionInfo { crate_name: \" rustc_tools_util\" , major: 0, minor: 3 , patch: 0 }"
180
178
) ;
181
179
}
182
180
}
0 commit comments