Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4dcf0bd

Browse files
author
whbrown
committed
Create labocédai; Move TS into typescriptions
1 parent bef6681 commit 4dcf0bd

File tree

125 files changed

+43
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+43
-2
lines changed

‎.gitignore

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
node_modules/
21
.env
3-
.vscode/
2+
.vscode/
3+
4+
# TS
5+
node_modules/
6+
7+
# Generated by Cargo
8+
# will have compiled files and executables
9+
debug/
10+
target/
11+
12+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
13+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
14+
Cargo.lock
15+
16+
# These are backup files generated by rustfmt
17+
**/*.rs.bk
18+
19+
# MSVC Windows builds of rustc generate these, which store debugging information
20+
*.pdb

‎labocédai/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "labocédai"
3+
version = "0.1.0"
4+
authors = ["whbrown"]
5+
edition = "2021"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]

‎labocédai/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pub mod sum_up_to;
2+
3+
#[cfg(test)]
4+
mod tests {
5+
use crate::sum_up_to::*;
6+
7+
#[test]
8+
fn test_sum_up_to() {
9+
assert_eq!(sum_up_to(5), 5 + 4 + 3 + 2 + 1);
10+
assert_eq!(sum_up_to(0), 0);
11+
}
12+
}

‎labocédai/src/sum_up_to.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub fn sum_up_to(num: usize) -> usize {
2+
(0..=num).into_iter().fold(0, |acc, n| acc + n)
3+
}
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /