Rust

Rust Code Screenshot Generator

Turn Rust snippets into images worth sharing, without leaving your Mac.

Rust snippets carry a lot of punctuation, so the theme you pick does more work than usual in keeping them readable.

Codeshot detects Rust from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.

use std::fs;

#[derive(Debug)]
pub struct Snapshot<'a> {
    pub code: &'a str,
    pub scale: u8,
}

impl<'a> Snapshot<'a> {
    fn save(&self, path: &str) -> std::io::Result<()> {
        fs::write(path, self.render())
    }
}
Solarized · dark
use std::fs;

#[derive(Debug)]
pub struct Snapshot<'a> {
    pub code: &'a str,
    pub scale: u8,
}

impl<'a> Snapshot<'a> {
    fn save(&self, path: &str) -> std::io::Result<()> {
        fs::write(path, self.render())
    }
}
Tokyo Night · dark
use std::fs;

#[derive(Debug)]
pub struct Snapshot<'a> {
    pub code: &'a str,
    pub scale: u8,
}

impl<'a> Snapshot<'a> {
    fn save(&self, path: &str) -> std::io::Result<()> {
        fs::write(path, self.render())
    }
}
Xcode · dark

Choosing a theme for Rust

Lifetimes and generics get lost in low-contrast themes. Solarized and Tokyo Night both keep operators distinct from identifiers, which is what you want when the borrow checker is the subject.

Getting the size right

Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with C, or save with S.

See all 30 themes side by side, or read the full workflow.

Built for Rust, and 59 other languages

Everything runs on your Mac. Your code never leaves it.

Download for macOS