3 ms·
If you don't use the result, how would you be able to get the handle that represents the open file?
by kccqzy 7y ago
If you don't use the result, how would you be able to get the handle that represents the open file?
- inferiorhuman 7y agoYou wouldn't. In this case a more likely example would be writing to the file. You don't have to check the return value (in C or Rust) to do something useful, but you should. In Rust you'll get a warning (or error depending on how your workspace is setup). In C, you won't get anything. It's also worth noting that the Result enum can be and is used for things beyond file I/O.