.rs

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

  1. Confirm the file really is a .rs. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
  2. On Windows, open it with VS Code or RustRover.
  3. On Mac, use VS Code or RustRover.
  4. On Linux, try VS Code or vim.
  5. 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.

Learn more about .rs