Rust – Binding delle variabili #2

MUTABILITA’

Di default, il bindings è immutabile, ad esempio:

let x = 5;
x = 10;

Se compili questo codice, riceverai questo errore:

error: re-assignment of immutable variable `x`
     x = 10;
     ^~~~~~~

Perchè di default per Rust le variabili, non sono variabili ma “costanti” (Detto in maniera non proprio corretta, ma giusto per esprimere al meglio in concetto), quindi di conseguenza non puoi riassegnare un valore, e per ovviare a questo aggiungeremo tra let e x, “l’escape”mut“. Come in questo esempio:

let mut x = 5;
x = 10;

Author: Neb

$whoami
Neb

$cat neb.txt

Keen on Computer Science, He always studies Computer Programming, Managment of Computer Systems and CyberSecurity (Offensive Side).
Have interest in experimental the use of new technologies. Co-founder of FreeNIX Security

My skills are:

Programming Skills:

– Web Development: JavaScript, PHP and HTML
– Desktop Application: Python3(Qt or GTK), C++(Qt)
– CLI Application: Python, C/C++, Crystal, Assembly and Rust

System Skills:

– Knowledge Unix Server System (CentOS, Ubuntu, Debian and BSD)
– Windows Server Administrator (AD, DC and many other)
– Virtualization with VMware, VirtualBox and Qemu

Network Skills:

– Indipendent Study of Routing and Switching

CyberSecurity Skills:

– Penetration Testing (Check Vuln):
– Exploitation
– Report

Location: Taranto, Apulia, Italy
Age: 18
Sex: Male