@@ -56,7 +56,7 @@ fn request(builder: RequestBuilder) -> Result<Document, StatusCode> {
5656
5757fn get_range ( page : & Document , property_name : & str ) -> RangeInclusive < u32 > {
5858 let node = page
59- . select ( Attr ( "name" , property_name) )
59+ . find ( Attr ( "name" , property_name) )
6060 . next ( )
6161 . unwrap_or_else ( || panic ! ( "Can't find node with name={}" , property_name) ) ;
6262 let min: u32 = node
@@ -75,7 +75,7 @@ fn get_range(page: &Document, property_name: &str) -> RangeInclusive<u32> {
7575fn get_dates_and_urls ( page : & Document ) -> Vec < ( u32 , String ) > {
7676 let mut res: Vec < ( u32 , String ) > = Vec :: new ( ) ;
7777 // Every second one is a date
78- for row in page. select ( And ( Class ( "t1n" ) , Name ( "tr" ) ) ) {
78+ for row in page. find ( And ( Class ( "t1n" ) , Name ( "tr" ) ) ) {
7979 let children: Vec < _ > = row. children ( ) . collect ( ) ;
8080 assert_eq ! ( children. len( ) , 2 ) ;
8181
@@ -98,7 +98,7 @@ fn get_rounds(page: &Document) -> impl Iterator<Item = String> + '_ {
9898 And ( Class ( "t2b" ) , Name ( "td" ) ) ,
9999 Or ( Name ( "a" ) , And ( Class ( "t2n" ) , Name ( "td" ) ) ) ,
100100 ) ;
101- page. select ( pred) . skip ( 5 ) . map ( |node| {
101+ page. find ( pred) . skip ( 5 ) . map ( |node| {
102102 if node. name ( ) == Some ( "a" ) {
103103 // Delimit round names with special characters
104104 "$ " . to_string ( ) + & node. text ( )
@@ -179,7 +179,7 @@ fn main() {
179179 comp_url
180180 ) ;
181181
182- let contest_name = match comp_page. select ( Class ( "h4" ) ) . next ( ) {
182+ let contest_name = match comp_page. find ( Class ( "h4" ) ) . next ( ) {
183183 Some ( node) => node. text ( ) ,
184184 None => "Nameless Contest" . to_string ( ) ,
185185 } ;
@@ -197,7 +197,7 @@ fn main() {
197197 & round_name,
198198 & mut num_rounds,
199199 /*This can be scraped from the O2CM results search. We'll leave it for now*/
200- Utc . ymd ( inyear as i32 , inmonth, inday) . and_hms ( 0 , 0 , 0 ) ,
200+ Utc . with_ymd_and_hms ( inyear as i32 , inmonth, inday, 0 , 0 , 0 ) . unwrap ( ) ,
201201 ) ;
202202 }
203203 round_name = tokens[ 1 ..tokens. len ( ) ] . join ( " " ) . to_string ( ) ;
@@ -235,7 +235,7 @@ fn main() {
235235 & contest_name,
236236 & round_name,
237237 & mut num_rounds,
238- Utc . ymd ( inyear as i32 , inmonth, inday) . and_hms ( 0 , 0 , 0 ) ,
238+ Utc . with_ymd_and_hms ( inyear as i32 , inmonth, inday, 0 , 0 , 0 ) . unwrap ( ) ,
239239 ) ;
240240 }
241241 Err ( status) => {
0 commit comments