본문 바로가기

rust26

[Rust 문서 읽기] 4. Understanding Ownership (소유권 이해하기) The Rust Programming Language - Ownership concept enables Rust to make memory safety guarantees without needing a G.C - What is Ownership? - Ownership is a set of rules that govern how a Rust program manages memory - memory is managed through a system of ownership with a set of rules that the compiler checks - None of the features of ownership will slow down your program while it's running - kee.. 2023. 1. 29.
[Rust 문서 읽기] 3. Common Programming Concepts (보편적인 프로그래밍 개념) The Rust Programming Language - Variables and Mutability - By default, variables are immutable -> safety & easy concurrency advantages - Adding mut in front of the variable name makes variable from immutable to mutable - constants - not allowed to use mut keyword with constants - always immutable - using the const keyword to make constants instead of let keyword - the type of the value must be a.. 2023. 1. 29.
[Rust 문서 읽기] 2. Programming a Guessing Game (추리 게임 튜토리얼) The Rust Programming Language - 1~100 random number generated and then user guess the number, after that computer checks if correct or not and gives high/low hint - Processing a Guess use rand::Rng; use std::cmp::Ordering; use std::io; fn main() { println!("Guess the number!"); let secret_number = rand::thread_rng().gen_range(1..=100); loop { println!("Please input your guess."); let mut guess =.. 2023. 1. 29.
[Rust 문서 읽기] 1. Getting Started (시작하기) The Rust Programming Language - Installation (macOs) - rustup: command line tool for managing Rust versions, associated tools $ curl https://sh.rustup.rs -sSf | sh $ source $HOME/.cargo/env $ rustc --version $ rustup update - Rustacean - offline doc: rustup doc - Hello, World! - IDE support via rust-analyzer - make a new source file and call it main.rs - filename convention: snake case - main fu.. 2023. 1. 28.
반응형