Skip to content

knknkn1162/err_handling_sample_rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Error handing example

Rust has Option and Result traits and has no exception, so the way of error handling is different from other popular languages, like golang or Python.

Some may be confused if he use it for the first time, so do I.. Here is an common example of handling error in rust.

Problem setting

Read file, parse numbers as i32 and aggregate them. Multiple Errors could occur when reading file or parsing numbers from String.

input: file
output: i32

references

see also,

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages