by Suf | May 20, 2022 | Programming, Rust, Tips
In Rust iter() returns an iterator of slices, into_iter() returns an iterator from a value, and iter_mut() returns an iterator that allows modifying each value. This tutorial will detail the Iterator and IntoIterator traits and the differences between the three...
by Suf | Mar 20, 2022 | Programming, Rust, Tips
This tutorial will go through how to read and write to a file for Rust version 1.26+ and Rust version 1.0. Table of contentsRead a File to String in Rust 1.26+Read a File to String in Rust 1.0Read a File to Vec<u8> in Rust 1.26+Read a File to Vec<u8> in Rust...
by Suf | Mar 20, 2022 | Programming, Rust, Tips
This tutorial will go through how to convert a string to an integer/float and vice versa. Table of contentsNumbers in RustIntegersFloatsRust Convert String to IntegerRust Convert Integer to StringRust Convert String to FloatRust Convert Float to StringRust Convert...
by Suf | Mar 19, 2022 | Programming, Rust, Tips
This tutorial will go through how to split a string in Rust. Table of contentsSplit String in Rust Using split()Split String in Rust Using split_whitespace()Split String in Rust Using lines()Split String in Rust Using RegexSplit String on Multiple Delimiters in...
by Suf | Mar 13, 2022 | NLP, Programming, Rust, Tips
This tutorial will go through concatenating strings and describe the two types of strings in Rust. Table of contentsStrings in RustConcatenate Strings in Rust using push_str()Concatenate Strings in Rust using format!()Concatenate Strings in Rust using +...
by Suf | Mar 2, 2022 | DSA, Programming, Rust, Tips
Bubble sort is a popular sorting algorithm that compares the adjacent elements in a list and swaps them if they are not in the specified order. This tutorial will go through how to implement the bubble sort algorithm in Rust with the help of code examples. Table of...