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

feat(chore): non-sense CLI args #2216

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 0 additions & 13 deletions mm2src/common/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,19 +518,6 @@ pub fn set_panic_hook() {
}))
}

/// Simulates the panic-in-panic crash.
pub fn double_panic_crash() {
struct Panicker;
impl Drop for Panicker {
fn drop(&mut self) { panic!("panic in drop") }
}
let panicker = Panicker;
if 1 < 2 {
panic!("first panic")
}
drop(panicker) // Delays the drop.
}

/// RPC response, returned by the RPC handlers.
/// NB: By default the future is executed on the shared asynchronous reactor (`CORE`),
/// the handler is responsible for spawning the future on another reactor if it doesn't fit the `CORE` well.
Expand Down
11 changes: 0 additions & 11 deletions mm2src/mm2_main/src/mm2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

#[cfg(not(target_arch = "wasm32"))] use common::block_on;
use common::crash_reports::init_crash_reports;
use common::double_panic_crash;
use common::log::LogLevel;
use common::password_policy::password_policy;
use mm2_core::mm_ctx::MmCtxBuilder;
Expand Down Expand Up @@ -248,16 +247,6 @@ pub fn mm2_main(version: String, datetime: String) {
// we're not checking them for the mode switches in order not to risk [untrusted] data being mistaken for a mode switch.
let first_arg = args_os.get(1).and_then(|arg| arg.to_str());

if first_arg == Some("panic") {
panic!("panic message")
}
if first_arg == Some("crash") {
double_panic_crash()
}
if first_arg == Some("stderr") {
eprintln!("This goes to stderr");
return;
}
if first_arg == Some("update_config") {
match on_update_config(&args_os) {
Ok(_) => println!("Success"),
Expand Down
Loading