Re: [swift-users] When does `Data.init?(capacity:)` fail?

2016-06-19 Thread Adrian Zubarev via swift-users
I’ve got an answer on Twitter for that behavior: https://twitter.com/phausler/status/743927492096851969 I’ve anyone like me needs Data to have a specific capacity and still be non-optional, here is how I build a workaround (Data and Data.Deallocator aren’t fully implemented yet, thats why I’m

Re: [swift-users] When does `Data.init?(capacity:)` fail?

2016-06-19 Thread Karl via swift-users
As I understand it, that’s not an error in the ‘try’ sense of the word. If that failure happens, it’s a catastrophic issue which should bring down the application. So the initialiser shouldn’t be failable; you’re right. File a bug at bugs.swift.org. Karl > On 18 Jun 2016, at 06:06, Saagar

Re: [swift-users] When does `Data.init?(capacity:)` fail?

2016-06-17 Thread Saagar Jha via swift-users
This might be relavant. Basically, Data’s init will fail if memory can’t be allocated for it. On Fri, Jun 17, 2016 at 11:38 AM Adrian Zubarev via swift-users < swift-users@swift.org> wrote: > Hello there, I’m trying to optimize my code