Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: indentation on handle exit process #18

Merged
merged 1 commit into from
Aug 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

impl Server {
pub fn new() -> Self {

Check warning on line 18 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

you should consider adding a `Default` implementation for `Server`

Check warning on line 18 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

you should consider adding a `Default` implementation for `Server`
Server { initialized: true }
}

Expand All @@ -38,7 +38,7 @@
panic!("An error occured, parameters need to be valid local host");
}

addr.push_str(&host);

Check warning on line 41 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

this expression creates a reference which is immediately dereferenced by the compiler

Check warning on line 41 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

this expression creates a reference which is immediately dereferenced by the compiler
addr.push(':');
addr.push_str(&port.to_string());

Expand Down Expand Up @@ -109,6 +109,7 @@
if let Err(e) = ctrlc::set_handler(move || {
exit.store(true, Ordering::SeqCst);
println!("Ctrl + C pressed. Exiting gracefully...");

process::exit(0);
}) {
panic!("{}", e);
Expand All @@ -129,7 +130,7 @@
let is_host_empty = host.is_empty();
let is_port_empty = port == 0;

match (is_host_empty, is_port_empty) {

Check warning on line 133 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

match expression looks like `matches!` macro

Check warning on line 133 in src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

match expression looks like `matches!` macro
(true, true) => true,
_ => false,
}
Expand Down
Loading