Skip to content

Language Rust

kazk edited this page Jan 18, 2021 · 9 revisions

Versions

  • 1.44 (edition = "2018")
  • 1.49 (edition = "2018")

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.44

  • bit-set: 0.5.2
  • chrono: 0.4.11
  • itertools: 0.9.0
  • lazy_static: 1.4.0
  • num: 0.2.1
  • quickcheck: 0.9.2
    • quickcheck_macros: 0.9.1
  • rand: 0.7.3
  • regex: 1.3.9
  • serde: 1.0.111
    • serde_derive: 1.0.111
    • serde_json: 1.0.53
  • text_io: 0.1.8

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