Closed meszarosdezso closed 2 years ago
This implements the Clone trait for the Trip struct (and thus for Frequency and StopTime too).
Clone
Trip
Frequency
StopTime
I am working on a project where I need to have an owned trip from the database, but since it was not clone-able I could only get a reference.
example code:
let trip: Trip = gtfs.trips.get("TRIP_ID").unwrap().clone();
before: error: expected Trip, found &Trip
error: expected Trip, found &Trip
after: compiles
Added a basic regression test.
This implements the
Clone
trait for theTrip
struct (and thus forFrequency
andStopTime
too).I am working on a project where I need to have an owned trip from the database, but since it was not clone-able I could only get a reference.
example code:
before:
error: expected Trip, found &Trip
after: compiles
Added a basic regression test.