diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8b543d3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +env: + CARGO_TERM_COLOR: always + +jobs: + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - run: cargo fmt --all -- --check + + clippy: + name: Clippy + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - run: cargo clippy --all-targets --all-features -- -D warnings + + test: + name: Tests + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - run: cargo test --all-targets --all-features --verbose diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index b84d9e2..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,36 +0,0 @@ -image: "rust:latest" - -variables: - RUSTFLAGS: -D warnings - -default: - before_script: - - rustc --version - - cargo --version - tags: - - shared-fi - -stages: - - build - -build: - stage: build - script: - - cargo build --verbose - -lint: - stage: build - script: - - rustup component add clippy - - cargo clippy --all-targets - -format: - stage: build - script: - - rustup component add rustfmt - - cargo fmt -- --check - -test: - stage: build - script: - - cargo test \ No newline at end of file diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md deleted file mode 100644 index a60a536..0000000 --- a/.gitlab/issue_templates/Bug.md +++ /dev/null @@ -1,28 +0,0 @@ -# Summary - -(Summarize the bug encountered concisely) - - -## Steps to reproduce - -(How one can reproduce the issue - this is very important) - -## What is the current bug behavior? - -(What actually happens) - -## What is the expected correct behavior? - -(What you should see instead) - -## Relevant logs and/or screenshots - -(Paste any relevant logs - use code blocks (```) to format console output, logs, and code, as -it's very hard to read otherwise.) - -## Possible fixes - -(If you can, link to the line of code that might be responsible for the problem) - -/label ~Bug -/label ~Reporter:: diff --git a/.gitlab/issue_templates/Default.md b/.gitlab/issue_templates/Default.md deleted file mode 100644 index f84fbc2..0000000 --- a/.gitlab/issue_templates/Default.md +++ /dev/null @@ -1,36 +0,0 @@ -Quick description of this feature. - -/label ~Reporter:: - -## 👤 User story - -“As a persona, I want_to, so_that.” - - - -## ✔️ Acceptance criteria - -- [ ] - -## ⚙️ Non-Funcional requirements - -- [ ] - -## 🖼️ Design - - diff --git a/.gitlab/merge_request_templates/Default.md b/.gitlab/merge_request_templates/Default.md deleted file mode 100644 index 493f053..0000000 --- a/.gitlab/merge_request_templates/Default.md +++ /dev/null @@ -1,27 +0,0 @@ - - - -Closes #n. - -Quick description of ticket & work. - -## 👉 Why? - -Description of why it's implemented how you've done it. E.g. what -fremework was chosen and why, other technical decisions. - -## 👀 How? - -Technical explanation of how the improvement was achieved. - -## 🖥️ See - -| 🥚 Before | 🐣 After | -| :----------------------------------: | :----------------------------------: | -| replace_with_comment_or_delete | replace_with_comment_or_delete | -| paste_screenshot_of_main_branch_here | paste_screenshot_of_your_branch_here | - -## ⏰ TODOs - -- [ ] todo which the reviewer take look at -- [ ] additional todo which has to be completed before merging diff --git a/lib/ref_tree/src/node_mod/node_to_root_iterator.rs b/lib/ref_tree/src/node_mod/node_to_root_iterator.rs index c167e86..fc5403e 100644 --- a/lib/ref_tree/src/node_mod/node_to_root_iterator.rs +++ b/lib/ref_tree/src/node_mod/node_to_root_iterator.rs @@ -17,9 +17,7 @@ impl Iterator for NodeToRootIterator { fn next(&mut self) -> Option { // Finish if we're at the root. - let Some(current) = self.node.clone() else { - return None; - }; + let current = self.node.clone()?; // Step up the tree. self.node = current diff --git a/lib/ref_tree/src/tree_mod/tree.rs b/lib/ref_tree/src/tree_mod/tree.rs index be01960..e216fe2 100644 --- a/lib/ref_tree/src/tree_mod/tree.rs +++ b/lib/ref_tree/src/tree_mod/tree.rs @@ -17,7 +17,7 @@ pub struct Tree { /// Some -> Tree has at least one node. /// /// Arc - Multi-thread simultaneous access to the root node. - /// RwLock + /// `RwLock` /// - Ability to read from one thread, but write from others without blocking. /// - BE writes when adding size from nodes under root, FE reads with tick/whenever. /// - BE also reads when asking for children or going up the three.