crates-io-demo-lib-nicu1989

Crates.iocrates-io-demo-lib-nicu1989
lib.rscrates-io-demo-lib-nicu1989
version0.1.0
created_at2025-08-31 13:41:56.387626+00
updated_at2025-08-31 13:41:56.387626+00
descriptionA minimal Rust library used to demo how to publish to crates.io.
homepagehttps://github.com/nicu1989/
repositoryhttps://github.com/nicu1989/public_sandbox
max_upload_size
id1818563
size19,907
Vinod Reddy (vinodreddy-g)

documentation

README

crates-io-demo-lib-nicu1989

A minimal Rust library used to demonstrate publishing to crates.io.

How to publish to crates.io

  1. Create a crates.io account and generate an API token (Account Settings).
  2. Authenticate locally:
    • cargo login <YOUR_API_TOKEN>
  3. Update Cargo.toml:
    • Ensure name is unique and owned by you.
    • Update description, repository, keywords, etc.
    • Keep license = "MIT OR Apache-2.0" or set your own.
  4. Dry run packaging:
    • cargo publish --dry-run
  5. Publish:
    • cargo publish

Releasing updates

  • Bump the version in Cargo.toml following SemVer.
  • Run cargo publish --dry-run, then cargo publish.

Notes

  • You must choose a unique crate name. crates-io-demo-lib is an example.
  • This crate is dual-licensed under MIT or Apache-2.0 just for demo purpose.

Usage

Add this crate to your Cargo.toml:

[dependencies]
crates-io-demo-lib-nicu1989 = "0.1"

Then call the function:

use crates_io_demo_lib::greet;

fn main() {
    println!("{}", greet("world"));
}
Commit count: 9

cargo fmt