Skip to content

Commit c082b88

Browse files
committed
Updated readme and added workflow
1 parent 47b6759 commit c082b88

6 files changed

Lines changed: 38 additions & 29 deletions

File tree

.github/workflows/Build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323

24+
- name: Install Prequisites
25+
run: |
26+
rustup target add wasm32-unknown-unknown
27+
cargo install trunk --locked
28+
cargo install tauri-cli
29+
2430
- name: Build
25-
run: cargo build --verbose
26-
27-
- name: Run tests
28-
run: cargo test --verbose
31+
run: cargo tauri build
32+

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
# SafeGen
2-
A simple easy to use password generator written in rust. Can endlessly generate strong passwords for optimal security.
1+
<div align="center">
2+
<h1>SafeGen</h1>
3+
</div>
34

4-
### Dependencies:
5-
[Rust compiler](https://www.rust-lang.org/)
5+
A simple Rust-based password generator creating strong, secure passwords endlessly for optimal security.
6+
7+
<div align="center">
8+
<img src="./assets/preview.png"/>
9+
</div>
610

711
### Prequisets
8-
`rustup target add wasm32-unknown-unknown`
9-
`cargo install trunk --locked`
12+
`rustup target add wasm32-unknown-unknown`
13+
`cargo install trunk --locked`
14+
`cargo install tauri-cli --version "^2.0.0" --locked`
1015

1116
### Testing
12-
To test the program run `cargo tauri dev`
17+
`cargo tauri dev`
1318

1419
### Building
15-
Simply run `cargo build`
20+
`cargo tauri build`

assets/preview.png

18.9 KB
Loading

src-tauri/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,15 @@ fn generate_password(length: u8, lower: bool, upper: bool, number: bool, symbol:
1818
.flat_map(|(set, _include)| set.chars());
1919

2020
let password = (0..length)
21-
.map(|_| chars_iter.clone().choose(&mut rand::thread_rng()).unwrap())
21+
.map(|_| chars_iter.clone().choose(&mut rand::rng()).unwrap())
2222
.collect();
2323

2424
return password;
2525
}
2626

2727
#[tauri::command]
2828
fn open_github() -> () {
29-
let url = "https://github.com/JerimiahOfficial";
30-
31-
match open::that(url) {
32-
Ok(()) => println!("Opened '{}' successfully.", url),
33-
Err(err) => panic!("An error occurred when opening '{}': {}", url, err),
34-
}
29+
open::that("https://github.com/JerimiahOfficial").expect("Failed to open GitHub page");
3530
}
3631

3732
#[cfg_attr(mobile, tauri::mobile_entry_point)]

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn app() -> Html {
115115
.trim()
116116
.to_string();
117117

118-
let new_history = format!("{}\n{}", password, history);
118+
let new_history = format!("{password}\n{history}");
119119

120120
history_input
121121
.cast::<web_sys::HtmlTextAreaElement>()
@@ -204,7 +204,7 @@ pub fn app() -> Html {
204204
length_label
205205
.cast::<web_sys::HtmlInputElement>()
206206
.unwrap()
207-
.set_inner_text(&format!("Password Length: {}", length));
207+
.set_inner_text(&format!("Password Length: {length}"));
208208
})
209209
};
210210

styles.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
padding: 0;
1515

1616
box-sizing: border-box;
17+
18+
-webkit-user-select: none;
19+
-moz-user-select: none;
20+
-ms-user-select: none;
21+
user-select: none;
1722
}
1823

1924
:root {
@@ -73,9 +78,15 @@ div {
7378
flex: 1 1 100%;
7479

7580
gap: 10px;
81+
82+
width: 100%;
7683
}
7784

78-
div input {
85+
div input[type="button"] {
86+
flex-basis: 50%;
87+
}
88+
89+
div label {
7990
flex-basis: 50%;
8091
}
8192

@@ -136,16 +147,10 @@ Check box stuff
136147
*/
137148

138149
.container {
139-
display: block;
140150
position: relative;
141151
padding-left: 35px;
142-
margin-bottom: 12px;
143-
cursor: pointer;
144152

145-
-webkit-user-select: none;
146-
-moz-user-select: none;
147-
-ms-user-select: none;
148-
user-select: none;
153+
line-height: 25px;
149154
}
150155

151156
.container input {

0 commit comments

Comments
 (0)