tumblr / colossus

I/O and Microservice library for Scala
Apache License 2.0
1.14k stars 96 forks source link

Turn traits into objects for easy implicit access #614

Closed benblack86 closed 6 years ago

benblack86 commented 7 years ago

I was messing around with cleaning up some imports I ran into a problem with an implicit being found in two places.

[error] /Users/benblack/Documents/pollscala/src/main/scala/com/tumblr/pollscala/PollscalaHandler.scala:125:14: ambiguous implicit values:
[error]  both object IdentityEncoder in trait HttpBodyEncoders of type colossus.protocols.http.HttpBody.IdentityEncoder.type
[error]  and object IdentityEncoder in trait HttpBodyEncoders of type colossus.protocols.http.package.IdentityEncoder.type
[error]  match expected type colossus.protocols.http.HttpBodyEncoder[colossus.protocols.http.HttpBody]
[error]           .ok(
[error]              ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 5 s, completed Oct 26, 2017 1:49:44 PM

I've turned HttpBodyEncoders and HttpBodyDecoders into companion objects for their implicits so they should be automatically found, rather then having to import from the http package.

@aliyakamercan @jlbelmonte @amotamed @dxuhuang @DanSimon

codecov-io commented 7 years ago

Codecov Report

Merging #614 into develop will increase coverage by 0.08%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #614      +/-   ##
===========================================
+ Coverage    84.88%   84.97%   +0.08%     
===========================================
  Files           99       99              
  Lines         4454     4454              
  Branches       344      344              
===========================================
+ Hits          3781     3785       +4     
+ Misses         673      669       -4
Impacted Files Coverage Δ
.../main/scala/colossus/protocols/http/HttpBody.scala 85.71% <ø> (ø) :arrow_up:
...c/main/scala/colossus/protocols/http/package.scala 30.76% <ø> (ø) :arrow_up:
colossus/src/main/scala/colossus/core/Worker.scala 78.76% <0%> (+1.76%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 88e0c52...32e53ce. Read the comment docs.