Rust | How To Build A Rust API Using Hyper? (Step-by-step)

APIs are a key component of modern applications no matter the programming language they are written. Learning how to build a Rust API can be seen as a challenging task, especially on a programming language that is considered hard and with a steep learning curve. Hopefully, you will learn how to build a Rust API … Read more

Rust | How to Read User Input (stdin) In Rust?

It is common to learn how to detect user input (stdin) when learning a new programming language, and Rust is not the exception. In this article, you will learn how to read the user input from a terminal. Here are the steps to read user input (stdin) in Rust: Import the std::io crate Generate a … Read more

JavaScript | How Double Bangs (Exclamation Marks) !! Work

In Javascript, most users are well familiar with the single exclamation mark (“!”) symbol (the logical “not” operator) used to reverse a boolean value. For example, !true will return false and !false will return true. Now, you must have come across the double exclamation mark !! symbols in your coding journey. Some developers call them … Read more

Rust | The Difference Between .clone() and .to_owned()

Chances are you recently came across the definition of the ToOwned trait to realize it is a generalization of the Clone trait? If so, what is the difference between the two traits? more specifically, what is the difference between .clone() and .to_owned() if they work the same? A generalization of Clone to borrowed data. https://doc.rust-lang.org/std/borrow/trait.ToOwned.html#tymethod.to_owned … Read more

Rust | How To Make an HTTP Request in Rust? (Step-by-step)

If you are relatively new to Rust, you probably have gone through a decent learning curve to understand the programming language concepts. Working with hardcoded data in your projects is not common when working on real-world application, but rather making HTTP requests to fetch data from other APIs. After all, do you know how to … Read more

JavaScript | What are Tuples and How to Use Them (examples)

If you have a Python background, you must have come across one of the four main built-in data types called Tuples used to store multiple items in a single variable. Previously, we didn’t have tuples in JavaScript, and programmers had to use various methods like array destructuring to play the role of tuples. But that … Read more

Rust | Difference Between iter(), iter_mut(), into_iter()

Rust iterators are data structures that contain a sequence of objects and allow the programmer to iterate them efficiently. However, like most things in Rust, iterators have a steep learning curve. The primary functions and concepts can be daunting, but don’t worry, we are here to do our absolute best to explain them. All three … Read more

Rust | Println! Doesn’t Work in Unit Tests (Solved)

If you are new to Rust programming language, there is a chance you are experiencing a deep learning curve in understanding how the programming language works. On top of that, you start writing your first couple of unit tests and suddenly realize that the logs from using the print or println! macro are not displayed … Read more