Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
refactor: make all extensions internal
Browse files Browse the repository at this point in the history
We don't want to expose these extensions, even though they might be
useful for other projects, because we want to have lean public APIs
which are easier to maintain.
  • Loading branch information
CassiusPacheco committed Aug 4, 2022
1 parent eb4bb2b commit 7d8144b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Sources/ImmutableXCore/Extensions/Array+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Foundation

// https://github.com/krzyzanowskim/CryptoSwift/blob/main/Sources/CryptoSwift/Array%2BExtension.swift#L34
public extension Array where Element == UInt8 {
extension Array where Element == UInt8 {
@inlinable
internal init(reserveCapacity: Int) {
init(reserveCapacity: Int) {
self = [Element]()
self.reserveCapacity(reserveCapacity)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ImmutableXCore/Extensions/BigInt+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BigInt
import Foundation

public extension BigInt {
extension BigInt {
var isEven: Bool {
magnitude[bitAt: 0] == false
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ImmutableXCore/Extensions/Data+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public extension Data {
extension Data {
init(hex: String) {
self.init([UInt8](hex: hex))
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ImmutableXCore/Extensions/Double+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public extension Double {
extension Double {
/// 64-bit floating-point number (double), printed in the style of %e if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise.
var asString: String {
// https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html
Expand Down
2 changes: 1 addition & 1 deletion Sources/ImmutableXCore/Extensions/Int+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public extension Int {
extension Int {
var asHexString: String {
String(format: "%02x", self)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ImmutableXCore/Extensions/String+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public extension String {
extension String {
/// Drops "0x" prefix if exists
var dropHexPrefix: String {
hasPrefix("0x") ? String(dropFirst(2)) : self
Expand Down

0 comments on commit 7d8144b

Please sign in to comment.