Rust · 250 KB

Large Rust file (about 10,000 lines)

1,999 generated functions in about 10,000 lines of valid Rust, for testing editors, syntax highlighters, linters and diff tools with big files.

CC0 · free for any use · Verified by an independent tool · Report a problem

sample-10000-lines.rs — first linesRust
// Generated 10,000-line Rust file — samplefiles.com

pub fn compute_0(values: &[f64]) -> f64 {
    // Scaled sum for batch 0
    values.iter().map(|v| v * 0 as f64).sum()
}

pub fn compute_1(values: &[f64]) -> f64 {
    // Scaled sum for batch 1
    values.iter().map(|v| v * 1 as f64).sum()
}

pub fn compute_2(values: &[f64]) -> f64 {
    // Scaled sum for batch 2
    values.iter().map(|v| v * 2 as f64).sum()
}

pub fn compute_3(values: &[f64]) -> f64 {
    // Scaled sum for batch 3
    values.iter().map(|v| v * 3 as f64).sum()
}

pub fn compute_4(values: &[f64]) -> f64 {
    // Scaled sum for batch 4
    values.iter().map(|v| v * 4 as f64).sum()

File details

Size
250 KB (256,596 bytes)
MIME type
text/x-rust
Lines
9,997
SHA-256
817eed4db81528a8af5841d2523194730618974b52c407909d8acbd9201efe30
MD5
d62b2dda930144c49bb293251061c7f5

Download from the command line

curl -L -o sample-10000-lines.rs https://files.samplefiles.com/code/rs/sample-10000-lines.rs

Or check the download in your browser with the checksum calculator.

Same sample in other formats

Python · 213 KBJavaScript · 205 KBJava · 264 KBC · 268 KBGo · 167 KB

Similar Rust files

FileSizeDetailsDownload
Sample Rust filemain.rs771 BDownload