This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
51 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: rust | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install deps | ||
run: sudo apt update && sudo apt install -y cargo | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,5 @@ | ||
# Leetcode | ||
|
||
My leetcode solutions in Rust | ||
My leetcode solutions | ||
|
||
|
||
## Usage | ||
|
||
Every directory under `problems/` is a cargo project which contains some basic test cases. | ||
|
||
The whole project is a cargo workspace, | ||
so all solutions can be tested using `cargo test` from repository root | ||
|
||
|
||
## Common | ||
|
||
The workspace contains a `common` crate which is used in tests | ||
and also contains leetcode-compatible definitions of common data structures, | ||
like `TreeNode` and `ListNode` | ||
![Visualization of this repo](./diagram.svg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
# Leetcode | ||
|
||
My leetcode solutions | ||
My leetcode solutions in Rust | ||
|
||
|
||
## Usage | ||
|
||
Every directory under `problems/` is a cargo project which contains some basic test cases. | ||
|
||
The whole project is a cargo workspace, | ||
so all solutions can be tested using `cargo test` from repository root | ||
|
||
|
||
## Common | ||
|
||
The workspace contains a `common` crate which is used in tests | ||
and also contains leetcode-compatible definitions of common data structures, | ||
like `TreeNode` and `ListNode` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,7 @@ impl Bitset { | |
|
||
#[cfg(test)] | ||
mod test { | ||
use common::assert_returns; | ||
|
||
|
||
use crate::Bitset; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters