Write a bubble sort in Rust
Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. This is repeated until the list is sorted.

Here’s an example of bubble sort in Rust:
```rust
fn bubble_sort(mut list: Vec<i32>) -> Vec<i32> {
    let n = list.len();
    for i in 0..n {
        for j in 0..n-i-1 {
            if list[j] > list[j+1] {
                list.swap(j, j+1);
            }
        }
    }
}
```
This function takes a vector of integers as an input argument and returns a sorted vector using the bubble sort algorithm.
Could you format it in a code block with Markdown and add indentation to make the code easier to read ?
Sure! Here's the code block with Markdown formatting and indentation:

```rust
fn bubble_sort(mut list: Vec<i32>) -> Vec<i32> {
    let n = list.len();
    for i in 0..n {
        for j in 0..n-i-1 {
            if list[j] > list[j+1] {
                list.swap(j, j+1);
            }
        }
    }
    list
}
```

This function takes a vector of integers as an input argument and returns a sorted vector using the bubble sort algorithm.