From: gfx Date: Fri, 9 Oct 2009 04:18:37 +0000 (+0900) Subject: Add "optimize_as" sugar to TC X-Git-Tag: 0.37_05~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d4810c114dba9cf2867925934d91fc3842f3faf;p=gitmo%2FMouse.git Add "optimize_as" sugar to TC --- diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index dde6dbb..4d2954e 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -9,7 +9,8 @@ use Mouse::Exporter; Mouse::Exporter->setup_import_methods( as_is => [qw( - as where message from via + as where message optimize_as + from via type subtype coerce class_type role_type enum find_type_constraint )], @@ -19,15 +20,10 @@ Mouse::Exporter->setup_import_methods( my %TYPE; -sub as ($) { - return(as => $_[0]); -} -sub where (&) { - return(where => $_[0]) -} -sub message (&) { - return(message => $_[0]) -} +sub as ($) { (as => $_[0]) } +sub where (&) { (where => $_[0]) } +sub message (&) { (message => $_[0]) } +sub optimize_as (&) { (optimize_as => $_[0]) } sub from { @_ } sub via (&) { $_[0] }