Rust, Software Development

Rust Stable And Rocket 0.5 Latest Development Codes

As posted in Rust Framework Rocket Goes Stable, Rocket will be compatible with Rust Stable, starting with version 0.5. It is almost September, and any time soon, we will have the new release. For those who cannot contain their excitement, we can already use the latest Rocket codes from the master branch for non-production codes. This post shows how to use the latest Rocket web framework development codes from GitHub using Rust stable.

Ensure We Are Using Atleast Rust Stable 1.45.0

Run the following command on the command line to check the version of our Rust stable.

For this post, we are using Rust 1.46.0.

Create A Rust Project

This post uses IntelliJ IDEA and an IntelliJ Rust plugin, to hasten the creation of a Rust project. Alternatively, we can use the Cargo CLI tools.

Modify [crayon-61e70dbe1bab5687600989-i/] To Use Rocket 0.5 (Latest Development Codes)

Then, modify the Cargo.toml file, as shown below.

In the file, we indicated a dependency on the Rocket framework codes (not a crate) in GitHub. The git property refers to the Git repository URL, while the branch property refers to the branch we will use.

Rust Rocket GitHub Repository

As we can see, the latest release is still Rocket 0.4.5. Therefore, we do not have a Rocket 0.5 crate yet.

Modify The [crayon-61e70dbe1babe836103642-i/] To Use Rocket 0.5 Compatible Codes

The following codes are sample codes from the Rocket GitHub repository URL.

If we are using codes example from Rocket 0.4.5 (via, they will not compile.

Rust Rocket 0.4.5 Crate

Test Rust Stable And Rocket 0.5 (Latest Development Codes)

To test our codes, run the  file within the IDE. We get the following output on the console.

Then, open and web browser and try the following URL – http://localhost:8000/hello/karl/24. We get the following page.

Since Rocket 0.5 release is not yet available officially, there may still be changes to the codebase. It is best to postpone any plans of migrating codes that rely on Rocket 0.4.5 and Rust nightly until we get the 0.5 release version.

This post is part of Rust Programming Language For Beginners Tutorial.

Got comments, or suggestions? Please visit our Facebook page!

You Might Also Like