- Http://www.linkedin.com/in/ptdecker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # flnm - Breaks apart a file's path by "/" and returns only the number of folder specified for each side, | |
| # followed by the file name. | |
| # | |
| # usage: flnm <filename> <leading elements> <trailing elements> | |
| # if <leading elements> is provided and <trailing elements> is omitted, then returns ONLY the back n portions | |
| # if <leading elements> is provided and <trailing elements> is omitted, then returns ONLY the file nane | |
| # if <leading elements> + <trailing elements> exceeds the file's actual path length, then returns full file path | |
| # if both <leading elements> and <trailing elements> are omitted, it assumes a value of 1 for each | |
| # | |
| # examples: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //! TOML Value Manipulation Demonstration | |
| //! | |
| //! This code is to supplement this excellent article: | |
| //! | |
| //! [Rust: Read, Write, and Modify .toml Files — Another way to handle User Set Environment Variables](https://medium.com/@itsuki.enjoy/rust-read-write-and-modify-toml-files-another-way-to-handle-user-set-environment-variables-27e1baf1a65f) | |
| //! | |
| //! This demo code assumes you have added additional entries to your ~/.cargo/config.toml file. Although, I used | |
| //! `foo` and `bar` instead of the `password` and `username` that the article uses. | |
| //! | |
| //! Put this code into `main.rs`. And, here is the corresponding `Cargo.toml` needed for this demo. |
OlderNewer