File tree Expand file tree Collapse file tree 1 file changed +0
-54
lines changed Expand file tree Collapse file tree 1 file changed +0
-54
lines changed Original file line number Diff line number Diff line change @@ -211,60 +211,6 @@ class DictionaryStorage {
211
211
212
212
}
213
213
214
- // MARK: - AnyInteger
215
-
216
- ///
217
- /// An object that wraps a generic integer value.
218
- ///
219
-
220
- class AnyInteger {
221
-
222
- private let stringGenerator : ( ) -> String
223
- private let intGenerator : ( ) -> Int
224
-
225
- /// Creates a wrapper from a base integer.
226
- init < T: FixedWidthInteger > ( _ base: T ) {
227
-
228
- stringGenerator = {
229
- return String ( base, radix: 10 , uppercase: false )
230
- }
231
-
232
- intGenerator = {
233
- return Int ( base)
234
- }
235
-
236
- }
237
-
238
- /// The `String` representation of the integer.
239
- var stringValue : String {
240
- return stringGenerator ( )
241
- }
242
-
243
- /// The `Int` representation of the integer.
244
- var rawValue : Int {
245
- return intGenerator ( )
246
- }
247
-
248
- /// Converts the integer to another integer type or returns `nil` if the target type is too
249
- /// small to contain the `intValue`.
250
- func makeSpecializedInteger< T: BinaryInteger & FixedWidthInteger > ( ) -> T ? {
251
-
252
- let intValue = self . rawValue
253
-
254
- guard T . bitWidth <= Int . bitWidth else {
255
- return nil
256
- }
257
-
258
- guard intValue >= T . min && intValue <= T . max else {
259
- return nil
260
- }
261
-
262
- return T ( intValue)
263
-
264
- }
265
-
266
- }
267
-
268
214
// MARK: - Escaping
269
215
270
216
extension String {
You can’t perform that action at this time.
0 commit comments