Online Rust Editor
Write, refactor, and download Rust source in the browser with completions, find, and format helpers.
Completions appear as you type; press Ctrl+Space to open the list. Tab expands snippets where available. Find: Ctrl+F (Cmd+F on Mac). Format: toolbar button or Ctrl+Shift+B for supported languages.
Choose editor font size in pixels
Starter snippet
fn main() {
let names = vec!["ace", "rust"];
let upper: Vec<_> = names.iter().map(|s| s.to_uppercase()).collect();
println!("{:?}", upper);
}Result + iterator
fn parse_ids(input: &str) -> Result<Vec<u32>, std::num::ParseIntError> {
input.split(',')
.map(str::trim)
.map(|s| s.parse())
.collect()
} Variables
let mut count = 0; let name = String::from("ct");Loops
for item in &items { } while cond { }Functions / methods
fn slug(input: &str) -> String { input.to_lowercase() }Comments
// line /* block */ /// docVariables
int count = 0;
const char *name = "ct";Loops
for (int i = 0; i < n; i++) { }
while (cond) { } Parse → transform → emit
// Rust pipeline sketch
const input = readLines();
const output = input
.map(line => line.trim())
.filter(Boolean)
.map(transform);
writeLines(output);Error handling wrapper
// Rust
function runSafely(task) {
try {
return { ok: true, value: task() };
} catch (err) {
return { ok: false, error: String(err) };
}
} - Does Rust code run on ConversionTab servers?
- No. Editing happens in your browser. Download the file and run it in your usual compiler, runtime, or platform.
- Can I change theme and font size?
- Yes. Use the toolbar above the editor; choices persist in local storage for your browser profile.