reverse ordering back to normal
This commit is contained in:
+3
-5
@@ -29,12 +29,10 @@ impl Extractor {
|
||||
}
|
||||
|
||||
pub(crate) fn get_departures<'a>(&'a self, html: &'a Html) -> impl Iterator<Item = ElementRef> {
|
||||
// `Select` does not implement DoubleEndedIterator, so we need to collect it first
|
||||
let mut result = html.select(&self.departure).collect::<Vec<_>>();
|
||||
result.reverse();
|
||||
let result: Vec<_> = html.select(&self.departure).collect();
|
||||
// we seem to extract the blocks twice with slightly different layout, so we discard half of them
|
||||
result.truncate(result.len() / 2);
|
||||
result.into_iter()
|
||||
let half = result.len() / 2;
|
||||
result.into_iter().take(half)
|
||||
}
|
||||
|
||||
pub(crate) fn get_transport_line(departure_block: scraper::ElementRef) -> Result<&str> {
|
||||
|
||||
Reference in New Issue
Block a user