Using Experimental Nightly Features

In this chapter, we will cover the following recipes:

  • Iterating over an inclusive range
  • Returning abstract types
  • Composing functions
  • Filtering strings efficiently
  • Stepping through an iterator in regular intervals
  • Benchmarking your code
  • Using generators

Introduction

This final chapter leads us to the most important experimental features in Rust, provided on the newest nightly toolchain. As of the time of writing, this is rustc 1.25.0-nightly. If you are using rustup (https://rustup.rs/), you can set it as your default toolchain like this:

rustup default nightly

These recipes will ensure that you stay ahead in your knowledge of Rust, and are ready to use them effectively once they are stabilized, or right ...

Get Rust Standard Library Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.