3 ms·
But the argument is an error message, so it's not "expect this to work"...
by einpoklum 7y ago
But the argument is an error message, so it's not "expect this to work"...
- azdle 7y agoThat's technically the second argument. Just like in C++, when using a chained method, the first argument is implied to be the thing you're chaining on. So this is the same thing as calling Result::expect(File::open(&input_filename), "[ ERROR ] Failed to open file!"), but I've never actually seen someone ever use expect that way. See also the definition of expect: https://doc.rust-lang.org/std/result/enum.Result.html#method.expect https://doc.rust-lang.org/std/result/enum.Result.html#method...