til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Installing Dependencies

Installing external libraries, components in Rust projects are pretty easy, but not as intuitive as one might expect - you have to do it manually like Perl’s carton, but unlike eg. JavaScript’s npm.

The build tool cargo does not handle this, but you have to specify the requirement manually in the projects Cargo.toml

This example is lifted from a small project I was working on when trying to learn about futures

[package]
name = "hello_futures"
version = "0.1.0"
authors = ["jonasbn <email@example.com>"]
edition = "2018"

[dependencies]
futures = ""

Under [dependencies] you simply specify the dependency. Do note that I am only scraping the surface, do the References below for more details.

References