commit 792690d210e442dbf1e58dd51a1b716a36f997fd
parent 1e683e236b0429823fdbcced528791bc33bcccc8
Author: Vlad-Stefan Harbuz <vlad@vladh.net>
Date: Sun, 9 Jan 2022 12:51:11 +0100
simplify clone()
Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>
Diffstat:
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/datetime/datetime.ha b/datetime/datetime.ha
@@ -99,29 +99,7 @@ export fn now() datetime = {
};
// Creates a copy of a [[datetime]]
-export fn clone(dt: datetime) datetime = {
- return datetime {
- date = dt.date,
- time = dt.time,
- loc = dt.loc,
- zone = dt.zone,
-
- era = dt.era,
- year = dt.year,
- month = dt.month,
- day = dt.day,
- isoweekyear = dt.isoweekyear,
- isoweek = dt.isoweek,
- week = dt.week,
- weekday = dt.weekday,
- yearday = dt.yearday,
-
- hour = dt.hour,
- min = dt.min,
- sec = dt.sec,
- nsec = dt.nsec,
- };
-};
+export fn clone(dt: datetime) datetime = dt;
// Creates a [[datetime]] from a [[chrono::moment]]
export fn from_moment(m: chrono::moment) datetime = {