Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
CECILIA-MULANDI authored Jan 3, 2025
2 parents 99d99f6 + 078cdf6 commit c2fb611
Show file tree
Hide file tree
Showing 5 changed files with 191 additions and 7 deletions.
36 changes: 36 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Copyright (c) 2024-present Rustfinity.
All Rights Reserved.

1. License Grant
Subject to the terms and conditions of this License, the Licensor hereby grants you a limited, non-exclusive, non-transferable, non-sublicensable right to view and use the software. This right is strictly for internal evaluation, testing, and development purposes only.

2. Restrictions

- You may not distribute, sublicense, sell, lease, rent, loan, or otherwise transfer the software or any portion of it to any third party without express written permission from the Licensor.
- You may not modify, adapt, or create derivative works of the software unless explicitly permitted by the Licensor in writing.
- You may not remove or alter any copyright notices, proprietary notices, trademarks, or other identifying marks from the software.

3. Ownership

- The Licensor retains all right, title, and interest in and to the software, including all intellectual property rights.
- No rights or licenses are granted by implication or estoppel.

4. Disclaimer of Warranty

- The software is provided on an “AS IS” basis without warranties or conditions of any kind, either express or implied, including, without limitation, warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement.
- The software is provided "as is" and no guarantees or warranties of any kind are provided.
- You assume all responsibility and risk for the use of the software.

5. Limitation of Liability
To the maximum extent permitted by law, in no event shall the Licensor be liable for any direct, indirect, incidental, special, exemplary, or consequential damages. This includes, but is not limited to, procurement of substitute goods or services, loss of use, data, or profits, or business interruption, however caused and under any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of the software.

6. Termination

- This License is effective until terminated.
- Your rights under this License will terminate automatically without notice if you fail to comply with any of its terms.
- Upon termination, you must immediately cease all use of the software and destroy or return all copies of the software in your possession or control.

7. Entire Agreement
This License constitutes the entire agreement between you and the Licensor concerning the software and supersedes all prior or contemporaneous understandings regarding such subject matter. Any modifications to this License must be in writing and signed by both parties.

If you do not agree with the terms of this License, you are not allowed to use or access the software in any manner.
154 changes: 148 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,155 @@
![Rustfinity.com](/images/rustfinity-header.png)
[![Rustfinity Banner](./images/rustfinity-header.png)](https://rustfinity.com)

# Rustfinity

A repository for all the publicly available content for Rustfinity.
<p>
<a href="https://rustfinity.com"><img src="https://img.shields.io/badge/Rustfinity%20Docs-18181B?style=flat&logo=rust" alt="Website"></a>
<a href="https://github.com/dcodesdev/rustfinity.com/blob/main/LICENSE"><img src="https://img.shields.io/github/license/dcodesdev/rustfinity.com.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
<a href="https://github.com/dcodesdev/rustfinity.com/issues"><img src="https://img.shields.io/github/issues/dcodesdev/rustfinity.com.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Issues"></a>
<a href="https://github.com/dcodesdev/rustfinity.com/pulls"><img src="https://img.shields.io/github/issues-pr/dcodesdev/rustfinity.com.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Pull Requests"></a>
</p>

## Crates
Rustfinity is an **interactive learning platform** dedicated to helping Rust developers of all levels learn and practice Rust programming concepts.
**[Visit our website → rustfinity.com](https://rustfinity.com)** to explore challenges, tutorials, and everything you need to level up your Rust skills!

- [CLI](crates/cli/)
> **Why Rustfinity?**
>
> - **Hands-on Learning**: Practice your Rust skills with real challenges in a fun environment.
> - **Comprehensive Exercises**: From basics to advanced topics—there’s something for everyone.
> - **Engaging Community**: Contribute, discuss, and grow alongside other Rust enthusiasts!
## Challenges
---

- [Challenges](challenges/)
## Table of Contents

- 🚀 [Getting Started](#-getting-started)
- 📂 [Folder Structure](#-folder-structure)
- [challenges/](#challenges)
- [crates/](#crates)
- 🤖 [Crates](#-crates-details)
- [cli](#cli)
- [rustfinity-runner](#rustfinity-runner)
- [syntest](#syntest)
- ❤️ [Contribute](#-contribute)
- 🏠 [Local Development](#-local-development)
- 🔗 [Follow Us](#-follow-us)
- ⚖️ [License](#-license)

---

## 🚀 Getting Started

1. **Head to [rustfinity.com](https://rustfinity.com)**
Explore available challenges and pick the ones you want to tackle.
2. **Try out the `cli` crate (optional)**
You can download challenges and practice them locally right from your terminal.
3. **Dive into the code**
Explore this repository to see how challenges and crates are structured.

---

## 📂 Folder Structure

```bash
.
├── challenges/
│ ├── challenge-1/
│ │ ├── description.md
│ │ ├── src/
│ │ │ ├── lib.rs
│ │ │ └── starter.rs
│ │ └── tests/
│ │ └── tests.rs
│ └── challenge-2/ (and so on...)
└── crates/
├── cli
├── rustfinity-runner
└── syntest
```

### <a name="challenges">challenges/</a>

This directory holds all the coding challenges served on [rustfinity.com](https://rustfinity.com). Feel free to submit new challenges, improve existing ones, or solve them locally using our CLI.

### <a name="crates">crates/</a>

This folder contains multiple Rust crates that power the Rustfinity platform.

---

## 🤖 <a name="crates-details">Crates</a>

### <a name="cli">`cli`</a>

- **What is it?**
The Rustfinity Command-Line Interface to help you **download, solve, and submit** Rustfinity challenges locally.
- **Key Features**
- Download any challenge directly to your local environment
- Submit solutions with `rustfinity submit` which redirects you to the challenge page with your solution

### <a name="rustfinity-runner">`rustfinity-runner`</a>

- **What is it?**
A crate designed for running challenge tests inside a secure Docker container.
- **Key Features**
- Spins up a temporary Docker container to safely execute user code
- Logs outputs and results from test runs
- Ensures a clean environment for each challenge submission

### <a name="syntest">`syntest`</a>

- **What is it?**
A specialized testing library built on top of Rust’s [`syn`](https://docs.rs/syn) library to analyze and validate Rust code syntax.
- **Key Features**
- Parse Rust AST (Abstract Syntax Tree) for testable patterns
- Provides an easy interface for writing **syntax-based** tests
- Helps ensure your Rust code meets style and syntactic guidelines

---

## ❤️ Contribute

We’d love your help! Whether it’s fixing bugs, adding challenges, or improving docs, every bit of help **matters**.

1. **Check out our [issues](https://github.com/dcodesdev/rustfinity.com/issues)**: Found a bug or want to suggest an enhancement? Open an issue!
2. **Fork & PR**: Fork the repo, make changes, and submit a pull request.
3. **Join our Discord**: [Join our Discord server](https://discord.gg/8GRcUqY48B) to discuss ideas, ask questions, or just hang out with the community.
4. **Spread the word**: Share Rustfinity with your friends, colleagues, or on social media.

---

## 🏠 Local Development

Ready to hack on Rustfinity locally? Here’s how:

```bash
# 1. Clone the repository
git clone https://github.com/dcodesdev/rustfinity.com.git
cd rustfinity.com

# 2. (Optional) Switch to a new branch for your work
git checkout -b my-new-feature

# 3. Explore and build
cargo build
```

We recommend installing [Docker](https://www.docker.com/) if you want to test the `rustfinity-runner` crate in a containerized environment.

---

## 🔗 Follow Us

Stay updated with the latest challenges, features, and announcements!

<p>
<a href="https://x.com/rustfinity"><img src="https://img.shields.io/badge/X-18181B?style=flat&logo=x&logoColor=white" alt="X"></a>
<a href="https://github.com/dcodesdev/rustfinity.com"><img src="https://img.shields.io/badge/GitHub-18181B?style=flat&logo=github&logoColor=white" alt="GitHub"></a>
<a href="https://discord.gg/8GRcUqY48B"><img src="https://img.shields.io/badge/Discord-18181B?style=flat&logo=discord&logoColor=white" alt="Discord"></a>
</p>

---

## ⚖️ License

This project is licensed under the [Rustfinity Proprietary License](https://github.com/dcodesdev/rustfinity.com/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion challenges/animal-sanctuary-registry/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Hashmaps are a powerful data structure that allow you to store **key-value pairs**. In Rust, the `HashMap` type is provided that uses the a **hashing algorithm** called **SipHash** to store keys and values in a way that allows for **fast and secure** lookups. Think of them as a dictionary in Python or an object in JavaScript.

In this challenge, we want to build a sanctuary registry that allows us to manage animals in different sections of the sanctuary. We'll use a `HashMap` to store the sections as keys and a `Vec` to store the animals in each section. Each key is a section name `String` and each value is a list of animals in that section `Vev<String>`.
In this challenge, we want to build a sanctuary registry that allows us to manage animals in different sections of the sanctuary. We'll use a `HashMap` to store the sections as keys and a `Vec` to store the animals in each section. Each key is a section name `String` and each value is a list of animals in that section `Vec<String>`.

## Task

Expand Down
1 change: 1 addition & 0 deletions challenges/declaring-variables/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ Then, calculate the area of a rectangle using the formula `area = width * height

- Use the `let` keyword to declare variables.
- Remember that variables declared with `let` are immutable by default.
- You do not need to explicitly annotate the types (e.g., `let width: u32 = 10;`) for the variables.
- Use multiplication `*` to calculate the area.
5 changes: 5 additions & 0 deletions challenges/find-the-first-palindrome/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ mod tests {
fn test_find_first_palindrome_edge_case() {
assert_eq!(find_first_palindrome(1, 1), Some(1));
}

#[test]
fn test_find_first_palindrome_negative_range() {
assert_eq!(find_first_palindrome(-1, 1), Some(0));
}
}

0 comments on commit c2fb611

Please sign in to comment.