πŸ“„Create the Cargo.toml

The Cargo.toml file is a manifest file for the Cargo package manager. This file contains metadata like name, version and dependencies for packages, which are called "crates" in Rust.

How to create Cargo.toml file?

Starting a new package with Cargo in an existing directory

Open Terminal in your project directory and run:

cargo init

If you prefer Cargo to create the directory automatically use cargo new botrs

Modify botrs to your project name following snake_case or kebab-case structure

You need Rust and Cargo installed on your computer, if not, follow the instructions below.

πŸ¦€pageRust

Putting dependencies in your Cargo.toml file

Installing serenity

Serenity - is a Rust library for the Discord API.

Add the following line to your Cargo.toml file or run cargo add serenity

Cargo.toml
[dependencies]
serenity = "0.11"

Last updated