Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
patochectp committed Apr 28, 2021
1 parent c3a4f0c commit 8bbd58e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/gtfs/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
self, Availability, CommentLinksT, Coord, KeysValues, Pathway, StopLocation, StopPoint,
StopTime as NtfsStopTime, StopTimePrecision, StopType, Time, TransportType, VehicleJourney,
},
read_utils::{read_collection, read_objects, read_objects_skip_error, FileHandler},
read_utils::{read_collection, read_objects, read_objects_loose, FileHandler},
utils::*,
Result,
};
Expand Down Expand Up @@ -335,7 +335,7 @@ where
for<'a> &'a mut H: FileHandler,
{
let file = "shapes.txt";
let mut shapes = read_objects_skip_error::<_, Shape>(file_handler, file, false)?;
let mut shapes = read_objects_loose::<_, Shape>(file_handler, file, false)?;
shapes.sort_unstable_by_key(|s| s.sequence);
let mut map: HashMap<String, Vec<Point<f64>>> = HashMap::new();
for s in &shapes {
Expand Down Expand Up @@ -777,7 +777,7 @@ where
{
let file = "pathways.txt";

let gtfs_pathways = read_objects_skip_error::<_, Pathway>(file_handler, file, false)?;
let gtfs_pathways = read_objects_loose::<_, Pathway>(file_handler, file, false)?;
let mut pathways = vec![];
for mut pathway in gtfs_pathways {
pathway.from_stop_type = skip_error_and_log!(
Expand Down Expand Up @@ -832,7 +832,7 @@ where
for<'a> &'a mut H: FileHandler,
{
let file = "transfers.txt";
let gtfs_transfers = read_objects_skip_error::<_, Transfer>(file_handler, file, false)?;
let gtfs_transfers = read_objects_loose::<_, Transfer>(file_handler, file, false)?;

let mut transfers = vec![];
for transfer in gtfs_transfers {
Expand Down
7 changes: 3 additions & 4 deletions src/ntfs/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use super::{Code, CommentLink, ObjectProperty, Stop, StopLocationType, StopTime}
use crate::model::Collections;
use crate::ntfs::has_fares_v2;
use crate::objects::*;
use crate::read_utils::{read_objects, read_objects_skip_error, PathFileHandler};
use crate::read_utils::{read_objects, read_objects_loose, PathFileHandler};
use crate::utils::make_collection_with_id;
use crate::Result;
use failure::{bail, ensure, format_err, ResultExt};
Expand Down Expand Up @@ -571,8 +571,7 @@ pub fn manage_object_properties(collections: &mut Collections, path: &path::Path

pub fn manage_geometries(collections: &mut Collections, path: &path::Path) -> Result<()> {
let mut file_handle = PathFileHandler::new(path);
let geometries =
read_objects_skip_error::<_, Geometry>(&mut file_handle, "geometries.txt", false)?;
let geometries = read_objects_loose::<_, Geometry>(&mut file_handle, "geometries.txt", false)?;
collections.geometries = CollectionWithId::new(geometries)?;

Ok(())
Expand Down Expand Up @@ -605,7 +604,7 @@ pub fn manage_pathways(collections: &mut Collections, path: &path::Path) -> Resu
let file = "pathways.txt";
let mut pathways = vec![];
let mut file_handle = PathFileHandler::new(path);
let ntfs_pathways = read_objects_skip_error::<_, Pathway>(&mut file_handle, file, false)?;
let ntfs_pathways = read_objects_loose::<_, Pathway>(&mut file_handle, file, false)?;
for mut pathway in ntfs_pathways {
pathway.from_stop_type = skip_error_and_log!(
collections
Expand Down
2 changes: 1 addition & 1 deletion src/read_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ where
}

/// Read a vector of objects from a zip in a file_handler ignoring error
pub(crate) fn read_objects_skip_error<H, O>(
pub(crate) fn read_objects_loose<H, O>(
file_handler: &mut H,
file_name: &str,
required_file: bool,
Expand Down

0 comments on commit 8bbd58e

Please sign in to comment.