@@ -5,21 +5,23 @@ use crate::RustVersion;
55/// [`channel`]: https://rust-lang.github.io/rustup/concepts/channels.html
66#[ derive( Clone , Debug , Eq , Hash , PartialEq , PartialOrd , Ord ) ]
77pub struct Beta {
8+ /// The three component Rust version
89 pub version : RustVersion ,
10+ /// The nth pre-release beta version, if any
911 pub prerelease : Option < u32 > ,
1012}
1113
1214#[ cfg( test) ]
1315mod tests {
14- use crate :: { Beta , RustVersion } ;
16+ use crate :: { channel :: Beta , RustVersion } ;
1517
1618 #[ yare:: parameterized(
1719 day1 = { RustVersion :: new( 0 , 0 , 0 ) , RustVersion :: new( 0 , 0 , 1 ) } ,
1820 month1 = { RustVersion :: new( 0 , 0 , 0 ) , RustVersion :: new( 0 , 1 , 0 ) } ,
1921 year1 = { RustVersion :: new( 0 , 0 , 0 ) , RustVersion :: new( 1 , 0 , 0 ) } ,
20- month_trumps_day = { RustVersion :: new( 0 , 0 , 999 ) , RustVersion :: new( 0 , 1 , 0 ) } ,
21- year_trumps_day = { RustVersion :: new( 0 , 0 , 999 ) , RustVersion :: new( 1 , 0 , 0 ) } ,
22- year_trumps_month = { RustVersion :: new( 0 , 999 , 0 ) , RustVersion :: new( 1 , 0 , 0 ) } ,
22+ month_over_day = { RustVersion :: new( 0 , 0 , 999 ) , RustVersion :: new( 0 , 1 , 0 ) } ,
23+ year_over_day = { RustVersion :: new( 0 , 0 , 999 ) , RustVersion :: new( 1 , 0 , 0 ) } ,
24+ year_over_month = { RustVersion :: new( 0 , 999 , 0 ) , RustVersion :: new( 1 , 0 , 0 ) } ,
2325 ) ]
2426 fn ord ( left : RustVersion , right : RustVersion ) {
2527 let left = Beta {
0 commit comments