Skip to content

Commit

Permalink
Merge pull request #19 from orchetect/dev
Browse files Browse the repository at this point in the history
Removed unused `.if` extension methods
  • Loading branch information
orchetect authored Nov 23, 2021
2 parents f7709dc + 72b43fd commit 8b9bd6c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 318 deletions.
26 changes: 13 additions & 13 deletions Sources/OTCore/Abstractions/Transformable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public protocol Transformable {

func transformed<T>(_ transform: (Self) throws -> T) rethrows -> T

mutating func transform(_ mutation: (inout Self) throws -> Void) rethrows -> Self
mutating func transform(_ transform: (inout Self) throws -> Void) rethrows -> Self

}

Expand Down Expand Up @@ -113,9 +113,9 @@ extension Transformable {
/// Mutate a value in place and also return it in order to continue chaining methods.
/// (Functional convenience method)
@inlinable @discardableResult public
mutating func transform(_ mutation: (inout Self) throws -> Void) rethrows -> Self {
mutating func transform(_ transform: (inout Self) throws -> Void) rethrows -> Self {

try mutation(&self)
try transform(&self)

return self

Expand All @@ -133,9 +133,9 @@ extension Transformable where Self : AnyObject {
/// Mutate a value in place and also return it in order to continue chaining methods.
/// (Functional convenience method)
@inlinable @discardableResult public
func transform(_ mutation: (Self) throws -> Void) rethrows -> Self {
func transform(_ transform: (Self) throws -> Void) rethrows -> Self {

try mutation(self)
try transform(self)

return self

Expand All @@ -162,9 +162,9 @@ extension Optional: Transformable {
/// Mutate a wrapped Optional in place and also return it in order to continue chaining methods.
/// (Functional convenience method)
@inlinable @discardableResult public
mutating func transformOptional(_ mutation: (inout Self) throws -> Void) rethrows -> Self {
mutating func transformOptional(_ transform: (inout Self) throws -> Void) rethrows -> Self {

try mutation(&self)
try transform(&self)

return self

Expand All @@ -182,9 +182,9 @@ extension Optional where Wrapped : AnyObject {
/// Mutate a value in place and also return it in order to continue chaining methods.
/// (Functional convenience method)
@inlinable @discardableResult public
func transform(_ mutation: (Self) throws -> Void) rethrows -> Self {
func transform(_ transform: (Self) throws -> Void) rethrows -> Self {

try mutation(self)
try transform(self)

return self

Expand Down Expand Up @@ -243,9 +243,9 @@ extension Equatable {
/// Mutate a value in place and also return it in order to continue chaining methods.
/// (Functional convenience method)
@inlinable @discardableResult public
mutating func transform(_ mutation: (inout Self) throws -> Void) rethrows -> Self {
mutating func transform(_ transform: (inout Self) throws -> Void) rethrows -> Self {

try mutation(&self)
try transform(&self)

return self

Expand All @@ -263,9 +263,9 @@ extension Equatable where Self : AnyObject {
/// Mutate a value in place and also return it in order to continue chaining methods.
/// (Functional convenience method)
@inlinable @discardableResult public
func transform(_ mutation: (Self) throws -> Void) rethrows -> Self {
func transform(_ transform: (Self) throws -> Void) rethrows -> Self {

try mutation(self)
try transform(self)

return self

Expand Down
169 changes: 0 additions & 169 deletions Sources/OTCore/Extensions/Swift/Equatable.swift

This file was deleted.

136 changes: 0 additions & 136 deletions Tests/OTCoreTests/Extensions/Swift/Equatable Tests.swift

This file was deleted.

0 comments on commit 8b9bd6c

Please sign in to comment.