Adding New Features #4
Answered
by
LF3551
BlinkBatToken
asked this question in
Q&A
-
|
I'd like to contribute to RustSecurePassGen by adding a new feature that allows users to save their generated passwords directly to a file. What would be the best way to approach this? Any guidance on where to start in the codebase? |
Beta Was this translation helpful? Give feedback.
Answered by
LF3551
Jun 19, 2024
Replies: 1 comment
-
Response to Adding New FeaturesTo add this feature, you can modify the use std::fs::File;
use std::io::Write;
fn save_password_to_file(password: &str, filename: &str) -> std::io::Result<()> {
let mut file = File::create(filename)?;
file.write_all(password.as_bytes())?;
Ok(())
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
BlinkBatToken
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Response to Adding New Features
To add this feature, you can modify the
src/main.rsfile to include file I/O operations. Use thestd::fs::Filemodule to create and write to a file. Here’s a basic example: