How do I run a project's example using Cargo?
You can run a specific example with:
cargo run --example name_of_example
where name_of_example
is the base filename (without .rs
)
or to run it in release mode:
cargo run --release --example name_of_example
To pass arguments to the example:
cargo run --example name_of_example -- arguments go here
cargo run
will automatically build (or rebuild) the program first if it's out of date.
Try the following:
cd rust-procol-ftp-client
cargo build --examples
./target/debug/examples/ftp-get