Skip to content

Commit

Permalink
Change callwith to callsame
Browse files Browse the repository at this point in the history
And minor spacing changes
  • Loading branch information
alabamenhu committed Jan 26, 2021
1 parent 8da0d7b commit 4f94570
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/DateTime/Timezones.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ role TimezoneAware[$olson = "Etc/GMT", $abbr = "GMT", $dst = False] {
method tz-abbr (--> Str) { $abbr }
method is-dst (--> Bool) { $dst }
}

subset NotTimezoneAware of DateTime where * !~~ TimezoneAware;

use DateTime::Timezones::Routines;
Expand Down Expand Up @@ -180,10 +181,10 @@ INIT {
INIT DateTime.^find_method('in-timezone').wrap(
method (|c) {
if CALLERS::<$*USE-ORIGINAL-DATETIME-NEW> {
return callwith self, c.list.head
return callsame
}

if c ~~ :($ where Int|Str) {
if c ~~ :($ where Int | Str) {
# TODO check if string can be made into integer
return self.new: self.posix, :timezone(c.list.head)
} else {
Expand Down

0 comments on commit 4f94570

Please sign in to comment.