Skip to content

thread 'main' panicked at 'Please supply a filename in the first argument. #1

@wardhills

Description

@wardhills

Nice project. Thank you.

When the project is run I get the following:

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/keepitsimple`
thread 'main' panicked at 'Please supply a filename in the first argument.', src/main.rs:20:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I am new to Rust. Is there some argument I am missing?

If the RUST_BACKTRACE=1 is set it returns:

$ RUST_BACKTRACE=1 cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running target/debug/keepitsimple
thread 'main' panicked at 'Please supply a filename in the first argument.', src/main.rs:20:38
stack backtrace:
0: rust_begin_unwind
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
2: core::panicking::panic_display
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:64:5
3: core::option::expect_failed
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:1638:5
4: core::option::Option::expect
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:709:21
5: keepitsimple::main
at ./src/main.rs:20:26
6: core::ops::function::FnOnce::call_once
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Thanks for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions