Configure dependencies with their minimum necessary scope to maintain clean architecture and improve build times. Key practices: 1. **Test-only dependencies should be dev-dependencies**
Configure dependencies with their minimum necessary scope to maintain clean architecture and improve build times. Key practices:
#[cfg(test)]
annotations:
// Instead of adding to main Cargo.toml
// unicode-width = "0.2"
// Add to [dev-dependencies] section instead
// And restrict usage to test code:
#[cfg(test)]
use unicode_width::UnicodeWidthStr;
// Instead of this in util/Cargo.toml:
// schemars.workspace = true
// Create plain enums in util:
pub enum SortStrategy {
Lexicographical,
Alphabetical,
}
// Then convert in settings module where JsonSchema is available
# In workspace Cargo.toml:
tokio = { version = "1.0", features = ["rt", "rt-multi-thread"] }
# In module Cargo.toml:
tokio.workspace = true
Enter the URL of a public GitHub repository