How to Set Up Rust with GitHub Codespaces or Gitpod

Configure a devcontainer.json file to automatically provision Rust 1.90 and required extensions for GitHub Codespaces and Gitpod.

Create a .devcontainer/devcontainer.json file in your repository root to define the Rust environment for GitHub Codespaces or Gitpod.

{
  "image": "mcr.microsoft.com/devcontainers/rust:1-1.90",
  "features": {
    "ghcr.io/devcontainers/features/docker-in-docker:2": {}
  },
  "customizations": {
    "vscode": {
      "extensions": ["rust-lang.rust-analyzer"]
    }
  }
}

For Gitpod, add a gitpod.yml file with the same image and extensions configuration to ensure consistent tooling across both platforms.