How to open a .rs file
Quick, free ways to open Rust on any system.
A .rs file is a Rust Source File. If double-clicking does nothing, your computer simply does not have an app that reads Rust yet. Here is how to fix that on each operating system, using free software wherever possible.
Open a .rs file step by step
- Confirm the file really is a .rs. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
- On Windows, open it with VS Code or RustRover.
- On Mac, use VS Code or RustRover.
- On Linux, try VS Code or vim.
- Still stuck? Convert the .rs to exe (via cargo build), which opens more widely.
Best apps to open .rs files
Windows
- VS Code
- RustRover
- any text editor
macOS
- VS Code
- RustRover
- any text editor
Linux
- VS Code
- vim
- any text editor
!
Before you open it: Caution. A .rs file is program source. Compiling and running it executes its code, so review untrusted files first.
Frequently asked questions
Why can't I open my .rs file?
Almost always because no installed app understands Rust. Install one of the apps above, or convert the file to a format your existing software already reads.
How do I run a .rs file?
In a Cargo project, cargo run builds and runs it. A single file can be compiled directly with rustc file.rs and then executed.
How do I open a .rs file?
Any text editor opens it. VS Code with the rust-analyzer extension adds completion, type hints and error checking.