From cb51bf36a6cd26bd127a9408bc25a45bcf530066 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 30 Dec 2017 14:41:22 +0000 Subject: move coercions to signatures --- lib/Ultramarine/Model/DB.pm6 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Ultramarine/Model/DB.pm6') diff --git a/lib/Ultramarine/Model/DB.pm6 b/lib/Ultramarine/Model/DB.pm6 index 596da6a..24a6a4a 100644 --- a/lib/Ultramarine/Model/DB.pm6 +++ b/lib/Ultramarine/Model/DB.pm6 @@ -159,14 +159,14 @@ class Ultramarine::Model::DB { return %song; } - method get-song(:$path!) { + method get-song(Str() :$path!) { my $sth = $!dbh.prepare(q:to/END/); SELECT * FROM songs WHERE path=? END LEAVE { .finish with $sth } - $sth.execute($path.Str); + $sth.execute($path); return unpack-row($sth.row(:hash)); } @@ -185,7 +185,7 @@ class Ultramarine::Model::DB { } } - method is-up-to-date(:$path!,:$mtime!) { + method is-up-to-date(Str() :$path!,:$mtime!) { my $sth = $!dbh.prepare(q:to/END/); SELECT COUNT(*) FROM songs @@ -193,7 +193,7 @@ class Ultramarine::Model::DB { AND mtime >= $mtime END LEAVE { .finish with $sth }; - $sth.execute($path.Str,$mtime); + $sth.execute($path,$mtime); return ($sth.row[0]//0).Bool; } } -- cgit v1.2.3