Skip to content

Commit

Permalink
replace JSON to JSON::XS
Browse files Browse the repository at this point in the history
  • Loading branch information
ritou committed Nov 8, 2013
1 parent 73cbeea commit 0759533
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cpanfile
Expand Up @@ -4,7 +4,7 @@ requires 'Data::Dump', '1.17';
requires 'Digest::SHA', '5.48';
requires 'Hash::MultiValue', '0.08';
requires 'IO::String', '1.08';
requires 'JSON', '2.21';
requires 'JSON::XS', '0';
requires 'LWP::UserAgent';
requires 'Params::Validate', '0.95';
requires 'Plack', '0.09942';
Expand Down
6 changes: 3 additions & 3 deletions lib/OAuth/Lite2/Formatter/JSON.pm
Expand Up @@ -5,20 +5,20 @@ use warnings;

use parent 'OAuth::Lite2::Formatter';

use JSON;
use JSON::XS;
use Try::Tiny;

sub name { "json" }
sub type { "application/json" };

sub format {
my ($self, $hash) = @_;
return JSON->new->encode($hash);
return JSON::XS->new->encode($hash);
}

sub parse {
my ($self, $json) = @_;
return JSON->new->decode($json);
return JSON::XS->new->decode($json);
}

=head1 NAME
Expand Down

0 comments on commit 0759533

Please sign in to comment.