Kevin
Kevin

Reputation: 53

How to change the app name but not library name of a package?

In Rust, I created one package and now I want to change only output app name without changing package name.

Below is the content of Cargo.toml file:

[package]
authors = ["Rust exam"]
edition = "2021"
name = "rust-exam"
description = "Rebuilt for Scale"
version = "1.10.0"
license = "Apache-2.0"

[dependencies]
base64 = "0.12.3"
clap = "2.33.1"
serde = "1.0.132"
serde_json = "1.0.73"
serde_yaml = "0.8.23"
tempfile = "3.2.0"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

When I input cargo build, it makes rust-exam and librust-exam. I want to only change rust-exam, not change package name. How can I do that?

Upvotes: 2

Views: 1043

Answers (1)

Ram Jai
Ram Jai

Reputation: 11

You can configure the app name like so:

[[bin]]
name = "rust-output"
path = "src/main.rs"

Upvotes: 1

Related Questions