Skip to content

Commit

Permalink
Remove redundant smartmatch usage in IO::Socket::Async
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaslak committed Nov 10, 2018
1 parent 307a98b commit 5522ee9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/IO/Socket/Async.pm6
Expand Up @@ -167,7 +167,7 @@ my class IO::Socket::Async {
$!close-vow.keep(True);
}

method connect(IO::Socket::Async:U: Str() $host, Int() $port where * ~~ Port-Number,
method connect(IO::Socket::Async:U: Str() $host, Int() $port where Port-Number,
:$enc = 'utf-8', :$scheduler = $*SCHEDULER) {
my $p = Promise.new;
my $v = $p.vow;
Expand Down Expand Up @@ -292,7 +292,7 @@ my class IO::Socket::Async {
method serial(--> True) { }
}

method listen(IO::Socket::Async:U: Str() $host, Int() $port where * ~~ Port-Number,
method listen(IO::Socket::Async:U: Str() $host, Int() $port where Port-Number,
Int() $backlog = 128, :$enc = 'utf-8', :$scheduler = $*SCHEDULER) {
my $encoding = Encoding::Registry.find($enc);
Supply.new: SocketListenerTappable.new:
Expand Down Expand Up @@ -331,7 +331,7 @@ my class IO::Socket::Async {
await $p
}

method bind-udp(IO::Socket::Async:U: Str() $host, Int() $port where * ~~ Port-Number,
method bind-udp(IO::Socket::Async:U: Str() $host, Int() $port where Port-Number,
:$broadcast, :$enc = 'utf-8', :$scheduler = $*SCHEDULER) {
my $p = Promise.new;
my $encoding = Encoding::Registry.find($enc);
Expand All @@ -357,12 +357,12 @@ my class IO::Socket::Async {
await $p
}

method print-to(IO::Socket::Async:D: Str() $host, Int() $port where * ~~ Port-Number,
method print-to(IO::Socket::Async:D: Str() $host, Int() $port where Port-Number,
Str() $str, :$scheduler = $*SCHEDULER) {
self.write-to($host, $port, $!encoder.encode-chars($str), :$scheduler)
}

method write-to(IO::Socket::Async:D: Str() $host, Int() $port where * ~~ Port-Number,
method write-to(IO::Socket::Async:D: Str() $host, Int() $port where Port-Number,
Blob $b, :$scheduler = $*SCHEDULER) {
my $p = Promise.new;
my $v = $p.vow;
Expand Down

0 comments on commit 5522ee9

Please sign in to comment.