본문 바로가기

Study/Rust

[Rust] Cargo 명령어

1. cargo build

 

$ cargo build
   Compiling hello_cargo v0.1.0 (file:///projects/hello_cargo)
    Finished dev [unoptimized + debuginfo] target(s) in 2.85 secs

 

2. cargo run

 

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/hello_cargo`
Hello, world!

 

3. cargo check

 

$ cargo check
   Checking hello_cargo v0.1.0 (file:///projects/hello_cargo)
    Finished dev [unoptimized + debuginfo] target(s) in 0.32 secs

 

exe를 만들지 않기 때문에 cargo build보다 빠르게 코드 작업을 체크하고 싶을 때 사용한다.

 

참고 : https://doc.rust-lang.org/book/

'Study > Rust' 카테고리의 다른 글

[Rust] Rust 설치 및 Cargo 프로젝트 생성 (Ubuntu 20.04 LTS)  (0) 2021.07.14