Publishing my project with a different name than my working directory

โš“ Rust    ๐Ÿ“… 2025-08-19    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 5      

surdeus

I tried publishing my project to crates.io so that potential users/collaborators can see its documentation. The problem is that the name cargo gave to it is the same as the working directory Iโ€™m currently using. So I tried changing the name field in my `Cargo.toml` file to the actual name of the project, and then the compiler had trouble finding some of the modules in the project. So, how can I publish my crate using the correct name (which is not the name of the working directory) without crashing the compiler?

Hereโ€™s a copy of my Cargo.toml file:

[package]

name = "question_bank_creator"
#name = "rebuild7"   // This is the name of the working directory

version = "0.29.8"
authors = ["John T. Reagan"]
license = "GPL-3.0-or-later"
readme = "README.md"
edition = "2021"
repository = "https://github.com/jtreagan/Question-Bank-Creator/tree/master"

description = "This program is targeted at teachers & homeschool parents and is especially useful for teaching math.  It allows the construction of test/worksheet/quiz questions that contain dynamic content.  The teacher can create variables that generate values/strings using random or pseudo-random criteria set by the user.  Once constructed, the question is stored in a file (or 'question bank') for later access as needed.  Teachers can also make the program/questions available to students for student directed practice."

[dependencies]
#Standard crates
rand = "0.8.5"

# Non-standard crates
num-traits = "0.2.19"
serde_json = "1.0.120"
serde = { version = "1.0.204", features = ["derive"] }
fltk = { version = "^1.5.5", features = ["fltk-bundled"] }

# Reagan created crates
lib_myfltk = "0.1.4"
#lib_myfltk = {path = "/home/jtreagan/programming/mine/lib_myfltk"}
lib_utils = "0.1.3"
lib_file = "0.1.2"
```

Thanks!

3 posts - 3 participants

Read full topic

๐Ÿท๏ธ Rust_feed