Skip to content

MihaiBogdanEugen/contacts-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

contacts-cli

Small app used for learning Rust

How To Run

$ make release
$ ./target/release/contacts-cli

Makefile

Check out the makefile for all the available targets

$ make help

Contacts CLI
Usage: 

  help      Prints this help message
  build     Compile the current package
  update    Update the dependencies of the current package
  run       Run a binary of the local package
  check     Analyze the current package and report errors, but don't build object files
  release   Release the current package
  clean     Clean the current package
  fmt       Format all Rust files of the current crate
  test      Run the tests

Implementation

Contact

  • phone_no is validated against r"49[0-9]{9,10}"
  • email is validated against r"^([a-z0-9_+]([a-z0-9_+.]*[a-z0-9_+])?)@([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6})"
pub struct Contact {
    pub name: String,
    pub phone_no: u64,
    pub email: String,
}

Collection

In memory tree map, using the name as key.

contacts: BTreeMap<String, Contact>,

Tag Along

Todos

  • search

About

Small app used for learning Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published