layer: remove unused error return from .Size() and .DiffSize()#43182
layer: remove unused error return from .Size() and .DiffSize()#43182thaJeztah merged 3 commits intomoby:masterfrom
Conversation
f26a3c3 to
f5d35b6
Compare
None of the implementations used return an error, so removing the error return can simplify using these. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
None of the implementations returned an error for this function, so removing it. Signed-off-by: Sebastiaan van Stijn <[email protected]>
f5d35b6 to
f9a1846
Compare
|
@tonistiigi this LGTY? |
tonistiigi
left a comment
There was a problem hiding this comment.
Isn't it better that Size() has the same signature as RWLayer?
|
So, that crossed my mind, but "it's complicated" The current situation is:
Based on the above, at least in the current state of things, I think there's enough differences between the two to change the signature independently AlternativeSo, an alternative could be to;
|
Arf, so that's not correct; |
|
Do we gain anything from having an explicitly shared interface? |
There was a problem hiding this comment.
LGTM -- IMO we're better off not returning an error object if it's always nil (it's just confusing to consumers to have an error return that's always nil), especially if we don't see any cases where it might not be in the future.
(Assuming there's not an actual benefit to making these share a common interface -- it seems more for cognitive load of using each of them than technical benefits?)
(Edit: see also https://twitter.com/cpuguy83/status/1492024002704863233 for a real world case where this type of misleading return signature causes pain 🙈)
None of the implementations used return an error, so removing the error
return can simplify using these.