---
title: loops in Rust
timestamp: 2024-04-30T14:20:01
author: szabgab
published: true
description: "There are three types of loops in Rust: for-in, while, and one called loop"
tags:
    - loops
    - loop
    - for
    - while
todo:
    - break
    - continue
---

There are 3 different loops in Rust

* [for in](/for-in-loops) when we want to iterate over the elements of an iterator.
* [while](/while-loop) when don't have the list of things to go over.
* [loop](/loop) when we want to check the exit condition after the first iteration already started. It is similar to `while true`, but more idiomatic and can also return a value.


