Skip to content

devcontainer for solving Rust kata locally

License

Notifications You must be signed in to change notification settings

codewars/rust-devcontainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rust-devcontainer

Rust devcontainer definition for VS Code Remote - Containers extension to easily develop locally in the same environment used by the CodeRunner.

If you're not familiar with devcontainers, see Developing inside a Container.

Usage

Open this project in a devcontainer with VS Code Remote - Containers extension.

Put your solution and tests in src/lib.rs:

fn add(a: i32, b: i32) -> i32 {
    a + b
}

// -------------------- 8< --------------------
#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_example() {
        assert_eq!(add(1, 1), 2);
    }
}

Then run cargo test. If the kata uses preloaded code, create lib/preloaded.rs.

Extensions

Only rust-analyzer and Better TOML are installed.

To install more extensions in the devcontainer, configure default extensions in your VS Code settings:

    "remote.containers.defaultExtensions": [
        "usernamehw.errorlens",
    ],

About

devcontainer for solving Rust kata locally

Topics

Resources

License

Stars

Watchers

Forks

Languages