Skip to content

Language Rust

kazk edited this page Feb 6, 2021 · 9 revisions

Versions

  • 1.49 (edition = "2018")

The following profiles are used to get decent performance in tests:

[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3

[profile.test]
opt-level = 1
[profile.test.package."*"]
opt-level = 3

Test Frameworks

Rust kata uses builtin #[test].

pub fn add(x: i32, y: i32) -> i32 { x + y }

tests will be a child module.

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn adds_i32() {
        assert_eq!(add(1, 1), 2);
    }
}

Timeout

12 seconds

Packages

1.49

[dependencies]
bit-set = "0.5.2"
chrono = "0.4.19"
futures = "0.3.10"
im = "15.0.0"
itertools = "0.10.0"
lazy_static = "1.4.0"
num = "0.3.1"
once_cell = "1.5.2"
rand = "0.8.1"
regex = "1.4.3"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
text_io = "0.1.8"
thiserror = "1.0.23"
tokio = { version = "1.0.1", features = ["full"] }
tokio-util = { version = "0.6.1", features = ["full"] }
[dev-dependencies]
quickcheck = "1.0.1"
quickcheck_macros = "1.0.0"

Services

None

Language ID

rust

Clone this wiki locally