diff --git a/src/vectorflow/neuralnet.d b/src/vectorflow/neuralnet.d index 41e5d1e..f7cb302 100644 --- a/src/vectorflow/neuralnet.d +++ b/src/vectorflow/neuralnet.d @@ -590,10 +590,8 @@ class NeuralNet { void serialize(string path) { auto f = File(path, "w"); - scope(exit) f.close(); scope(failure) { - f.close(); try { writeln("Serialization failed."); @@ -640,9 +638,6 @@ class NeuralNet { if(!exists(path)) throw new Exception("File does not exists: " ~ path); auto f = File(path, "r"); - scope(exit) f.close(); - scope(failure) f.close(); - auto nn = new NeuralNet(); auto deser = new Serializer(&f);