return; from with/etc.
Matt S Trout [Wed, 9 May 2012 18:01:41 +0000 (18:01 +0000)]
Changes
lib/Moo.pm

diff --git a/Changes b/Changes
index 5c8f676..b2c2c13 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+  - add an explicit return to all exported subs so people don't accidentally
+    rely on the return value
+
 0.091004 - 2012-05-07
   - also inhale from Mouse
   - clarify how isa and coerce interact
index f172159..3af5e7c 100644 (file)
@@ -30,6 +30,7 @@ sub import {
       grep defined, map Mouse::Util::find_meta($_), @_
     ] if $INC{"Mouse.pm"};
     $class->_maybe_reset_handlemoose($target);
+    return;
   };
   _install_coderef "${target}::with" => "Moo::with" => sub {
     require Moo::Role;
@@ -44,11 +45,13 @@ sub import {
     $class->_accessor_maker_for($target)
           ->generate_method($target, $name, \%spec);
     $class->_maybe_reset_handlemoose($target);
+    return;
   };
   foreach my $type (qw(before after around)) {
     _install_coderef "${target}::${type}" => "Moo::${type}" => sub {
       require Class::Method::Modifiers;
       _install_modifier($target, $type, @_);
+      return;
     };
   }
   {