Rust Series01 - Ownership is what you need to know
Source: Dev.to

Introduction
Hi fellows, I’ve been using Rust for about three years now, and I think it’s time to share some of my experience. This post kicks off a Rust language learning series that will continue over the next few weeks. Without further ado, let’s dive in.
Ownership in Rust
If you’re familiar with OOP languages like Java or C#, you know that everything revolves around objects. Rust, however, is not an OOP language; it is centered on ownership. Rust asks you explicitly: who owns a piece of memory?
Ownership answers the fundamental question:
Who is responsible for freeing this memory?
Core Ownership Rule (Only One Owner)
- Every value in Rust has exactly one owner at any given time.
let s = String::from("hello");
sowns the heap memory for"hello".- When
sgoes out of scope, the memory is freed automatically.