Previous to this changeset, the implementation of
FromStr for Schedule allocated internally.
The same was true for TryFrom<&str> for Schedule,
which forwarded to the former.
Library users had no way to prevent the unnecessary
double allocation where a heap-allocated String
representation is already available,
whose ownership could be passed into the Schedule.
This changeset implements efficient conversion
from Cow<'_, str>, String and &str.
Borrowed expressions are only heap-allocated
if parsing succeeds.
Ownership of owned expressions is passed into
the Schedule, circumventing the previous double
allocation.
Previous to this changeset, the implementation of
FromStr for Schedule
allocated internally.The same was true for
TryFrom<&str> for Schedule
, which forwarded to the former.Library users had no way to prevent the unnecessary double allocation where a heap-allocated
String
representation is already available, whose ownership could be passed into theSchedule
.This changeset implements efficient conversion from
Cow<'_, str>
,String
and&str
.Borrowed expressions are only heap-allocated if parsing succeeds.
Ownership of owned expressions is passed into the
Schedule
, circumventing the previous double allocation.Implements #127