'c' function is unnecessary
Dan Book [Mon, 9 Nov 2015 05:04:06 +0000 (00:04 -0500)]
lib/DOM/Tiny/Collection.pm
t/collection.t

index e94e715..0f678c2 100644 (file)
@@ -3,16 +3,11 @@ package DOM::Tiny::Collection;
 use strict;
 use warnings;
 use Carp 'croak';
-use Exporter 'import';
 use List::Util;
 use Scalar::Util 'blessed';
 
 our $VERSION = '0.001';
 
-our @EXPORT_OK = ('c');
-
-sub c { __PACKAGE__->new(@_) }
-
 sub new {
   my $class = shift;
   return bless [@_], ref $class || $class;
@@ -134,10 +129,6 @@ DOM::Tiny::Collection - Collection
     say "$num: $word";
   });
 
-  # Use the alternative constructor
-  use DOM::Tiny::Collection 'c';
-  c(qw(a b c))->join('/')->url_escape->say;
-
 =head1 DESCRIPTION
 
 L<DOM::Tiny::Collection> is an array-based container for collections of
@@ -148,17 +139,6 @@ L<DOM::Tiny> nodes or other items based on L<Mojo::Collection>.
   $collection->[23] += 100;
   say for @$collection;
 
-=head1 FUNCTIONS
-
-L<DOM::Tiny::Collection> implements the following functions, which can be imported
-individually.
-
-=head2 c
-
-  my $collection = c(1, 2, 3);
-
-Construct a new array-based L<DOM::Tiny::Collection> object.
-
 =head1 METHODS
 
 L<DOM::Tiny::Collection> implements the following methods.
index a98eba2..0c6332f 100644 (file)
@@ -1,9 +1,11 @@
 use strict;
 use warnings;
 use Test::More;
-use DOM::Tiny::Collection 'c';
+use DOM::Tiny::Collection;
 use JSON::PP ();
 
+sub c { DOM::Tiny::Collection->new(@_) }
+
 # Array
 is c(1, 2, 3)->[1], 2, 'right result';
 is_deeply [@{c(3, 2, 1)}], [3, 2, 1], 'right result';