This repo provides starter code containing the execution context needed to make debugging easier in any Rust program.
To install and run Rust program hello-rust:
git clone https://github.com/wilsonmar/rustlang-samples --depth 1
cd rustlang-samplesThis repo currently has a single sample Rust program. Go to it:
cd src/hello-rust
ls -alPlease read the README.md file there.
These programs were created with the help of several AI tools, including Claude and Warp Oz.
Several policies were defined to guide code creation:
POLICY: Generally, issue results from functions rather than print formatted output so that the calling function has a choice of natural languages to present results.
POLICY: Within main(), uniquely identify each step to provide the AI a way to reference code rather than using more cumbersome line numbers. The AI can renumber sequentially numbered steps automatically when asked.
POLICY: Do not store sensitive values in clear-text .env files, even though they are in the user home folder. Store secrets in a local secrets database such as KeepassXC.
POLICY: Use the zeroize crate to securely wipe the master password from memory as soon as the database is decrypted.
To access a database from multiple threads (e.g., in a Tauri or Axum web app), wrap crypto keys in a Mutex inside a single thread, or decrypt what you need and pass the decrypted strings (carefully) to other threads.