Open codeOfRobin opened 7 years ago
There are a lot of whitespace changes in this. Was this on purpose or is it your editor deciding this?
I think it's best if the PR is just the logic changes. We can always go and do whitespace fixes in a dedicated change.
I suspect it's Atom doing it. ¯_(ツ)_/¯.
Ah, sorry missed that it was Atom.
I'm not comfortable accepting this PR with all the whitespace changes, but it might be ok with @Anviking
I'll split it into 2 PRs (I think that's an amicable solution).
BTW @Anviking There's another reason a linux port would be hard. NSDictionary <-> Swift dictionary conversion on Linux is buggy as hell. For example,
let y: [String: Int] = ["a": 1]
guard let x = y as? NSDictionary else {
print("not succeeded")
exit(1)
}
will work on MacOS but will fail on Linux ( warning: cast from '[String : Int]' to unrelated type 'NSDictionary' always fails
)
Turns out, this won't be possible on Linux at all (I posted this bug earlier today): https://bugs.swift.org/browse/SR-3411
Does this mean, there's no way to get Decodable onto Linux?
@codeOfRobin I think the dependency on NSJSONSerialization
could be separated (with #if os
) quite easily. Would be kind of interesting to do actually. Would need a suitable replacement parser though.
Though it still will generate warnings on MacOS. Another thing that's weird is,
swift build
won't work because of the files in theTests
folder.Someone who's more well versed with Swift Package manager should probably check up on this(I am open to discussing possible restructuring in the comments).
The changes are, otherwise, super small (adding
?
s. Though Atom seems to have messed up the whitespace somehow ¯\_(ツ)_/¯