From: Fuji, Goro Date: Tue, 28 Sep 2010 12:35:36 +0000 (+0900) Subject: Cleanup X-Git-Tag: 0.77~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=18cab6b8665e31ac5c38895c434862e4393fee57;p=gitmo%2FMouse.git Cleanup --- diff --git a/lib/Mouse/PurePerl.pm b/lib/Mouse/PurePerl.pm index c5256c1..31a9647 100644 --- a/lib/Mouse/PurePerl.pm +++ b/lib/Mouse/PurePerl.pm @@ -5,11 +5,11 @@ use strict; use warnings; use warnings FATAL => 'redefine'; # to avoid to load Mouse::PurePerl twice +use Scalar::Util (); use B (); require Mouse::Util; - # taken from Class/MOP.pm sub is_valid_class_name { my $class = shift; @@ -134,12 +134,11 @@ sub generate_can_predicate_for { package Mouse::Util::TypeConstraints; -use Scalar::Util (); sub Any { 1 } sub Item { 1 } -sub Bool { $_[0] ? $_[0] eq '1' : 1 } +sub Bool { !$_[0] || $_[0] eq '1' } sub Undef { !defined($_[0]) } sub Defined { defined($_[0]) } sub Value { defined($_[0]) && !ref($_[0]) }