├── .devcontainer └── devcontainer.json ├── .github └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md └── tests └── test_main.rs /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/rust 3 | { 4 | "name": "Rust", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "mcr.microsoft.com/devcontainers/rust:0-1-bullseye", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": [ 10 | "rust-lang.rust-analyzer", 11 | "vadimcn.vscode-lldb", 12 | "GitHub.copilot-nightly" 13 | ] 14 | } 15 | }, 16 | 17 | // Use 'postCreateCommand' to run commands after the container is created. 18 | "postCreateCommand": "rustc --version" 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is an example GitHub Actions workflow that will allow you to build your project with every push or pull request. 2 | # For more information, see: 3 | # https://docs.github.com/actions/reference/workflow-syntax-for-github-actions 4 | 5 | name: Rust Build 6 | 7 | on: 8 | pull_request: 9 | branches: [main] 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Set up Rust 18 | uses: actions/setup-rust@v1 19 | with: 20 | rust-version: stable 21 | - name: Build 22 | run: cargo build --verbose -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | debug/ 4 | target/ 5 | 6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 8 | Cargo.lock 9 | 10 | # These are backup files generated by rustfmt 11 | **/*.rs.bk 12 | 13 | # MSVC Windows builds of rustc generate these, which store debugging information 14 | *.pdb 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Alfredo Deza 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | .PHONY: help 3 | 4 | help: 5 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' 6 | 7 | clean: ## Clean the project using cargo 8 | cargo clean 9 | 10 | build: ## Build the project using cargo 11 | cargo build 12 | 13 | lint: ## Lint the project using cargo 14 | @rustup component add clippy 2> /dev/null 15 | cargo clippy 16 | 17 | fmt: ## Format the project using cargo 18 | @rustup component add rustfmt 2> /dev/null 19 | cargo fmt 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=665539593) 2 | 3 | # Rust template 4 | 5 | _This template repository is part of a 4-week Rust course, [start on week 1 here](https://github.com/alfredodeza/rust-setup) if you want to learn more about Rust!_ 6 | 7 | This Rust template is meant to help you get quickly started with a new project. It is [Codespaces enabled](https://docs.github.com/en/codespaces/overview) and it is pre-configured with useful extensions like the [Rust Analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer&WT.mc_id=academic-0000-alfredodeza) and [GitHub Copilot](https://docs.github.com/en/copilot/quickstart) 8 | 9 | This repository is configured as a GitHub Template, so that you can start fresh with a new repository without carrying the history and commits of this repository. To get started you can click on the "Use this template" green button, or follow this [link directly](https://github.com/alfredodeza/rust-template/generate) 10 | 11 | This is the Rust template used as part of the [Rust Bootcamp](https://s.deza.pe/zjo). There are 4 weeks in total: 12 | 13 | - [week 1](https://github.com/alfredodeza/rust-setup) 14 | - [week 2](https://github.com/alfredodeza/rust-fundamentals) 15 | - [week 3](https://github.com/alfredodeza/rust-structs-types-enums/) 16 | - [week 4](https://github.com/alfredodeza/applied-rust) 17 | - [Rust Template](https://github.com/alfredodeza/rust-template) 👈 You are here! 18 | 19 | 20 | 🚀 **Watch the Video course** 21 | 22 | [![O'Reilly](https://learning.oreilly.com/covers/urn:orm:video:28080717VIDEOPAIML/400w/)](https://s.deza.pe/zjo "Rust Bootcamp") 23 | 24 | ## Get started 25 | 26 | To get started with this template, once you've [generated the repository](https://github.com/alfredodeza/rust-template/generate), run the following `cargo` command (replace my-project with the name of your project): 27 | 28 | ```bash 29 | cargo init --name my-project . 30 | ``` 31 | 32 | This will initialize the project with the name you provided. You can now start editing the `src/main.rs` file and start building your project. 33 | 34 | ## Make changes 35 | 36 | Make changes to this repository so that it reflects your own project. Start by updating the license which is currently set to MIT. You can do this by editing the `LICENSE` file. You can also update the `README.md` file to reflect a descriptiton of your own project. 37 | 38 | ## GitHub Actions 39 | 40 | This template comes with a GitHub Actions workflow that will run on every push to the repository. The workflow will run `cargo build` and `cargo test` to make sure that your project builds and that all tests pass. You can find the workflow file in `.github/workflows/rust.yml` 41 | 42 | ## GitHub Codespaces 43 | 44 | This template is [Codespaces enabled](https://docs.github.com/en/codespaces/overview). This means that you can start a new Codespace from this repository and start working on your project right away. To do this, click on the green "Code" button and select "Open with Codespaces". This will start a new Codespace for you and you can start editing the `src/main.rs` file right away. 45 | 46 | ## Resources 47 | 48 | This template repository is part of a 4-week Rust course, [start on week 1 here](https://github.com/alfredodeza/rust-setup) if you want to learn more about Rust! 49 | 50 | **O'Reilly Courses** 51 | 52 | - [DevOps command-line tools in Python and Rust](https://learning.oreilly.com/videos/devops-command-line-tools/28037639VIDEOPAIML/) 53 | 54 | **Coursera Courses** 55 | 56 | - [MLOps Machine Learning Operations Specialization](https://www.coursera.org/specializations/mlops-machine-learning-duke) 57 | - [Linux and Bash for Data Engineering](https://www.coursera.org/learn/linux-and-bash-for-data-engineering-duke) 58 | - [Open Source Platforms for MLOps](https://www.coursera.org/learn/open-source-platforms-duke) 59 | - [Python Essentials for MLOps](https://www.coursera.org/learn/python-essentials-mlops-duke) 60 | - [Web Applications and Command-Line tools for Data Engineering](https://www.coursera.org/learn/web-app-command-line-tools-for-data-engineering-duke) 61 | - [Python and Pandas for Data Engineering](https://www.coursera.org/learn/python-and-pandas-for-data-engineering-duke) 62 | - [Scripting with Python and SQL for Data Engineering](https://www.coursera.org/learn/scripting-with-python-sql-for-data-engineering-duke) 63 | -------------------------------------------------------------------------------- /tests/test_main.rs: -------------------------------------------------------------------------------- 1 | // update this file with your own tests 2 | --------------------------------------------------------------------------------