
Cargo & Ecosystem
Cargo commands, dependencies, features, build scripts, workspaces, crates.io, documentation
1Which Cargo command compiles a project without creating a final executable?
Which Cargo command compiles a project without creating a final executable?
Odpowiedź
The cargo check command compiles the code to verify errors without producing a final binary. This command is much faster than cargo build because it skips the machine code generation step. It is ideal during development to quickly validate that the code compiles correctly.
2How to specify a dependency with a minimum version of 1.2.0 but less than 2.0.0 in Cargo.toml?
How to specify a dependency with a minimum version of 1.2.0 but less than 2.0.0 in Cargo.toml?
Odpowiedź
The serde = "1.2" syntax uses Cargo's default semantic versioning. It means Cargo will accept any version compatible with 1.2.0, i.e., >= 1.2.0 and < 2.0.0. This notation is equivalent to serde = "^1.2" and is the idiomatic way to specify dependencies in Rust.
3What is the role of the Cargo.lock file in a Rust project?
What is the role of the Cargo.lock file in a Rust project?
Odpowiedź
The Cargo.lock file records the exact versions of all dependencies used during the last successful compilation. This ensures reproducible builds by using exactly the same versions across different machines. For libraries, this file is typically ignored in git, but for binaries and applications, it should be versioned.
How to define an optional feature in Cargo.toml?
What is the purpose of the build.rs file at the root of a Cargo project?
+15 pytań z rozmów
Inne tematy rekrutacyjne Rust
Rust Basics
Ownership & Borrowing
Structs & Enums
Error Handling
Collections
Modules & Packages
Traits
Generics
Lifetimes
Iterators & Closures
Smart Pointers
Concurrency Basics
async/await
Testing
Pattern Matching
Macros
Serde & Serialization
Unsafe Rust
Advanced Traits
Advanced Lifetimes
Type System
Tokio & Async I/O
Performance Optimization
Memory Management
Web Frameworks
Database Integration
Rust Design Patterns
Opanuj Rust na następną rozmowę
Uzyskaj dostęp do wszystkich pytań, flashcards, testów technicznych, ćwiczeń code review i symulatorów rozmów.
Zacznij za darmo