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
// 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
Download from the command line
curl -L -o sample-10000-lines.rs https://files.samplefiles.com/code/rs/sample-10000-lines.rswget https://files.samplefiles.com/code/rs/sample-10000-lines.rshttps://files.samplefiles.com/code/rs/sample-10000-lines.rsprintf '%s %s\n' 817eed4db81528a8af5841d2523194730618974b52c407909d8acbd9201efe30 sample-10000-lines.rs | shasum -a 256 -cOr 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
| File | Size | Details | Download |
|---|---|---|---|
| Sample Rust filemain.rs | 771 B | Download |