]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Functor/Rule.pm
Document the return value of LT::Functor::Rule::insert
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Functor / Rule.pm
index df5b553eb5a7256dd7e253f029c75f16d42a230f..bccbb48d739707e5a5f416d4356c98533596416d 100644 (file)
@@ -129,6 +129,8 @@ If C<$replace> is false, then the rule will be appended to the C<@list> ; except
 If C<$replace> is true, then the rule will replace the first rule in the list that is a subclass or that consumes the role denoted by the target.
 All the subsequent rules in the list that inherit or consume the target will be removed.
 
+Returns true if and only if an existent rule was replaced.
+
 =cut
 
 sub insert {
@@ -140,9 +142,6 @@ sub insert {
  my $overwrite = $args{overwrite};
  my $replace   = $args{replace};
 
- my $target  = $rule->target;
- my $is_role = $rule->is_role;
-
  if ($replace) {
   my (@remove, $replaced);
 
@@ -166,6 +165,7 @@ sub insert {
   return 1 if $replaced;
 
  } else { # Replace only an existent rule
+  my $target  = $rule->target;
 
   for my $i (0 .. $#$list) {
    my $old_target = $list->[$i]->target;