Copilot configuration for Rust systems programming.
# GitHub Copilot Rust Configuration
## Ownership Patterns
```rust
// Prefer borrowing
fn process(data: &[u8]) -> Result<(), Error> {
// Read-only access
Ok(())
}
// Mutable borrowing
fn modify(data: &mut Vec<u8>) {
data.push(0);
}
```
## Error Handling
```rust
use thiserror::Error;
#[derive(Error, Debug)]
pub enum AppError {
#[error("Not found: {0}")]
NotFound(String),
#[error(transparent)]
Database(#[from] sqlx::Error),
}
fn get_user(id: &str) -> Result<User, AppError> {
users.get(id)
.cloned()
.ok_or_else(|| AppError::NotFound(id.into()))
}
```
## Async Patterns
```rust
use tokio;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let result = fetch_data().await?;
println!("{:?}", result);
Ok(())
}
```
## Cargo.toml Dependencies
- Use specific versions
- Document why each dependency is needed
- Minimize dependencies when possibleBest practices and patterns for using GitHub Copilot with TypeScript projects.
Cursor rules for Rust development with focus on memory safety, ownership, and performance.
Optimize GitHub Copilot suggestions for React and TypeScript development.
Copilot
systems
AI coding rules customize how GitHub Copilot generates and refactors code for your project. Follow these steps to install GitHub Copilot Rust Guidelines.
.cursor/rules, for Windsurf use .windsurfrulesBest practices and patterns for using GitHub Copilot with TypeScript projects.
Cursor rules for Rust development with focus on memory safety, ownership, and performance.
Optimize GitHub Copilot suggestions for React and TypeScript development.