Skip to content

Comments

Set a panic hook if use_std#1

Open
AlexKnauth wants to merge 1 commit intoLiveSplit:masterfrom
AlexKnauth:std-panic
Open

Set a panic hook if use_std#1
AlexKnauth wants to merge 1 commit intoLiveSplit:masterfrom
AlexKnauth:std-panic

Conversation

@AlexKnauth
Copy link

As suggested by @CryZe in the Speedrun Tool Develop discord for improving error messages in the ASR debugger when it's using std.

When use_std is false, the start of main looks like

async fn main() {
    // TODO: Set up some general state and settings.

with no blank line between the { brace and the TODO comment.

And when use_std is true, the start of main looks like

async fn main() {
    std::panic::set_hook(Box::new(|panic_info| {
        asr::print_message(&panic_info.to_string());
    }));

    // TODO: Set up some general state and settings.

with a blank line between the set_hook call and the TODO comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant