Use helper instead of using the full class name
authorVincent Tondellier <tonton+hg@team1664.org>
Sat, 24 Nov 2012 23:16:50 +0100
changeset 16 76a5a48538e4
parent 15 394f772a8105
child 17 c91535b1db3e
Use helper instead of using the full class name
CrashTest.pl
--- a/CrashTest.pl	Sat Nov 24 23:15:47 2012 +0100
+++ b/CrashTest.pl	Sat Nov 24 23:16:50 2012 +0100
@@ -16,6 +16,7 @@
 use Mojolicious::Lite;
 use UUID;
 use Mojo::JSON;
+use Mojo::ByteStream 'b';
 use Mojo::UserAgent;
 use lib 'lib';
 use CrashTest::Storage::FileSystem;
@@ -36,7 +37,7 @@
         my $filename = File::Spec->splitpath($scmpath);
         my $scmrepo = "$scm:$repo";
         if(exists($config->{ScmLinks}->{$scmrepo})) {
-            return Mojo::ByteStream->new($self->link_to("$filename:$line" =>
+            return b($self->link_to("$filename:$line" =>
                     $self->render(inline => $config->{ScmLinks}->{$scmrepo},
                         repo => $repo, scmpath => $scmpath, rev => $rev, line => $line, partial => 1)
                 ));
@@ -63,7 +64,7 @@
         # c/c++
         $short_signature = "$1()$2";
     }
-    return Mojo::ByteStream->new($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
+    return b($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
 };
 
 # Upload form in DATA section