//
//  UIView+Utils.swift
//  App
//
//  Created by James Magahern on 8/5/22.
//

import UIKit

infix operator .. : AssignmentPrecedence

@discardableResult @inline(__always) @inlinable
public func .. <T: Any>(it: T, apply: (inout T) throws -> Void) rethrows -> T {
    var it = it
    try apply(&it)
    return it
}

protocol Conf { }

extension Conf {
    @discardableResult
    func conf(_ block: (Self) -> Void) -> Self {
        block(self)
        return self
    }
}

extension UIView: Conf {}
