Bump Rust to 1.80.0

This commit is contained in:
Jeehoon Kang
2024-07-29 01:11:35 +09:00
parent 578a679d19
commit 7a2fa9193a
6 changed files with 128 additions and 162 deletions

217
README.md
View File

@@ -3,16 +3,19 @@
## Logistics ## Logistics
- Instructor: [Jeehoon Kang](https://cp.kaist.ac.kr/jeehoon.kang) - Instructor: [Jeehoon Kang](https://cp.kaist.ac.kr/jeehoon.kang)
- Time: Mon & Wed 14:30pm-15:45pm - Time: Mon & Wed 14:30-15:45 (2024 Fall)
- Place - Place
+ Rm. 304, Bldg. E11. **YOUR PHYSICAL ATTENDANCE IS REQUIRED** unless announced otherwise. + Rm. 1501, Bldg. E3-1. **YOUR PHYSICAL ATTENDANCE IS REQUIRED** unless announced otherwise.
+ [Zoom room](https://kaist.zoom.us/my/jeehoon.kang) (if remote participation is absolutely necessary). The passcode is announced at KLMS. + [Zoom room](https://kaist.zoom.us/my/jeehoon.kang) (if remote participation is absolutely necessary).
- Websites: <https://github.com/kaist-cp/cs220>, <https://gg.kaist.ac.kr/course/17/> Ask Jeehoon via email for the passcode.
- Websites: <https://github.com/kaist-cp/cs220>, <https://gg.kaist.ac.kr/course/20/>
- Announcements: in [issue tracker](https://github.com/kaist-cp/cs220/issues?q=is%3Aissue+is%3Aopen+label%3Aannouncement) - Announcements: in [issue tracker](https://github.com/kaist-cp/cs220/issues?q=is%3Aissue+is%3Aopen+label%3Aannouncement)
+ We assume you read each announcement within 24 hours. + We assume you read each announcement within 24 hours.
+ We strongly recommend you to watch the repository. + We strongly recommend you to watch the repository.
- TA: [Haechan An](https://cp.kaist.ac.kr/haechan.an), [Jungin Rhee](https://cp.kaist.ac.kr/jungin.rhee), [Woojin Lee](https://cp.kaist.ac.kr/woojin.lee) - TA: TBA
+ Office Hour: Fri 9:15am-10:15am, Rm. 4432, Bldg. E3-1. If you want to come, do so by 9:30am. See [below](https://github.com/kaist-cp/cs220#rules) for office hour policy. + Office Hours: Fri 9:00-10:00, Rm. 4441, Bldg. E3-1.
If you want to come, do so by 9:15.
See [below](https://github.com/kaist-cp/cs220#rules) for the office hour policy.
<!-- Fri 9:00am-12:00pm, [Zoom room](https://zoom.us/j/4842624821)(The passcode is same as the class). It is not required, but if you want to come, do so by 9:30am. See [below](#communication) for office hour policy. --> <!-- Fri 9:00am-12:00pm, [Zoom room](https://zoom.us/j/4842624821)(The passcode is same as the class). It is not required, but if you want to come, do so by 9:30am. See [below](#communication) for office hour policy. -->
- **IMPORTANT**: you should not expose your work to others. In particular, you should not fork - **IMPORTANT**: you should not expose your work to others. In particular, you should not fork
the [upstream](https://github.com/kaist-cp/cs220) and push there. the [upstream](https://github.com/kaist-cp/cs220) and push there.
@@ -28,29 +31,28 @@
### Prerequisites ### Prerequisites
- It is **strongly recommended** that students already took courses on: - It is **strongly recommended** that students have completed courses in:
+ Mathematics (MAS101): proposition statement and proof + Mathematics (MAS101): proposition statement and proof
+ Programming (CS101): basic programming skills + Programming (CS101): basic programming skills
- Without a proper understanding of these topics, you will likely struggle in this course. A solid foundation in these areas is crucial for success in this course.
- In the assignment, for the concepts that don't come out in prerequisite courses, we tried to comment on the relevant resources in the assignment code. Please read them carefully.
### Schedule
TBA
### Tools ### Tools
Make sure that you're capable of using the following development tools: Ensure you are proficient with the following development tools:
- [Git](https://git-scm.com/): for downloading the homework skeleton and version-controlling your - [Git](https://git-scm.com/): Essential for downloading homework templates and managing your development process.
development. If you're not familiar with Git, walk through [this If you're new to Git, please complete [this tutorial](https://www.atlassian.com/git/tutorials).
tutorial](https://www.atlassian.com/git/tutorials).
+ **IMPORTANT**: you should not expose your work to others. In particular, you should not fork
the [upstream](https://github.com/kaist-cp/cs220) and push there. Please the following
steps:
* Directly clone the upstream without forking it.
+ Follow these steps to set up your repository:
* Clone the upstream repository directly without forking it:
```bash ```bash
$ git clone --origin upstream git@github.com:kaist-cp/cs220.git $ git clone --origin upstream git@github.com:kaist-cp/cs220.git
$ cd cs220 $ cd cs220
@@ -58,22 +60,16 @@ Make sure that you're capable of using the following development tools:
upstream git@github.com:kaist-cp/cs220.git (fetch) upstream git@github.com:kaist-cp/cs220.git (fetch)
upstream git@github.com:kaist-cp/cs220.git (push) upstream git@github.com:kaist-cp/cs220.git (push)
``` ```
* To receive updates from the upstream, fetch and merge `upstream/main`:
* To get updates from the upstream, fetch and merge `upstream/main`.
```bash ```bash
$ git fetch upstream $ git fetch upstream
$ git merge upstream/main $ git merge upstream/main
``` ```
+ If you want to manage your development in a Git server, please create your own private + For managing your development on a Git server, create a private repository:
repository. * Upgrade to a "PRO" GitHub account, available at no cost.
See the [documentation](https://education.github.com/students).
* You may upgrade your GitHub account to "PRO", which is free of charge. * Configure your repository as a remote:
Refer to the [documentation](https://education.github.com/students).
* Set up your repository as a remote.
```bash ```bash
$ git remote add origin git@github.com:<github-id>/cs220.git $ git remote add origin git@github.com:<github-id>/cs220.git
$ git remote -v $ git remote -v
@@ -82,69 +78,59 @@ Make sure that you're capable of using the following development tools:
upstream git@github.com:kaist-cp/cs220.git (fetch) upstream git@github.com:kaist-cp/cs220.git (fetch)
upstream git@github.com:kaist-cp/cs220.git (push) upstream git@github.com:kaist-cp/cs220.git (push)
``` ```
* Push your work to your repository:
* Push to your repository.
```bash ```bash
$ git push -u origin main $ git push -u origin main
``` ```
- [Rust](https://www.rust-lang.org/): as the language of homework implementation. We chose Rust - [Rust](https://www.rust-lang.org/): You will use Rust for homework.
because its ownership type system greatly simplifies the development of large-scale system We chose Rust because its ownership type system greatly simplifies the development of large-scale system software.
software. + `cargo doc --open` on your local will show you the documentation for each homework.
- We recommend you to read [this page](https://cp.kaist.ac.kr/helpdesk#technical-expertise) that describes how to study Rust.
- `cargo doc --open` on your local will show you the documentation for each homework.
- [ChatGPT](https://chat.openai.com/) or other LLMs (optional): for your homework. - [ChatGPT](https://chat.openai.com/) or other Large Language Models (LLMs) (optional): Useful for completing your homework.
- In the era of AI, we believe that it is crucial to learn how to wisely use AI in programming. + In an AI-driven era, learning to effectively utilize AI in programming is crucial.
- So we adjusted the difficulty of homework assuming that you'll use ChatGPT 3.5 (or equivalent) to solve it. Homework difficulty is adjusted assuming the use of ChatGPT 3.5 or an equivalent tool.
- [Visual Studio Code](https://code.visualstudio.com/) (optional): for developing your homework. If you prefer other editors, you're good to go. - [Visual Studio Code](https://code.visualstudio.com/) (optional): Recommended for developing your homework, although you may use any editor of your preference.
- [Single Sign On (SSO)](https://auth.fearless.systems/) - [Single Sign On (SSO)](https://auth.fearless.systems/): Use the following SSO credentials to access [gg](https://gg.kaist.ac.kr) and the [development server](https://cloud.fearless.systems):
+ id: KAIST student id (8-digit number)
+ email: KAIST email address (@kaist.ac.kr)
+ password: Reset it here: <https://auth.fearless.systems/if/flow/default-recovery-flow/>
+ Log in to [gg](https://gg.kaist.ac.kr) using the "kaist-cp-class" option, and to the [development server](https://cloud.fearless.systems) using the "OpenID Connect" option.
You can log in to [gg](https://gg.kaist.ac.kr) and [development server](https://cloud.fearless.systems) using the following SSO account: - [Development Server](https://cloud.fearless.systems/):
+ id: KAIST student id (8-digit number) + **IMPORTANT: Do not attempt to hack or overload the server. Please use it responsibly.**
+ email: KAIST email address (@kaist.ac.kr) + Create and connect to a workspace to use the terminal or VSCode (after installation).
+ password: please reset it here: <https://auth.fearless.systems/if/flow/default-recovery-flow/> + We recommend using VSCode with the "Rust Analyzer" and "CodeLLDB" plugins.
For [gg](https://gg.kaist.ac.kr), please log in with the "kaist-cp-class" option.
For [development server](https://cloud.fearless.systems), please log in with the "OpenID Connect" option.
- [Development server](https://cloud.fearless.systems/)
+ **IMPORTANT: Don't try to hack. Don't try to freeze the server. Please be nice.**
+ You can create and connect to a workspace to open terminal or VSCode (after installing it).
+ We recommend you to use VSCode and its "Rust Analyzer" and "CodeLLDB" plugins.
## Grading & honor code ## Grading & Honor code
### Cheating ### Cheating
**IMPORTANT: PAY CLOSE ATTENTION. VERY SERIOUS.** **IMPORTANT: READ CAREFULLY. THIS IS A SERIOUS MATTER.**
- Please sign the KAIST CS Honor Code for this semester. - Sign the KAIST CS Honor Code for this semester.
Otherwise, you may be expelled from the course. Failure to do so may lead to expulsion from the course.
- We will use sophisticated tools for detecting code plagiarism. - We will employ sophisticated tools to detect code plagiarism.
+ Search for "code plagiarism detector" on Google Images to understand how these tools can identify advanced forms of plagiarism.
+ [Google "code plagiarism detector" for images](https://www.google.com/search?q=code+plagiarism+detector&tbm=isch) and see how these tools can detect "sophisticated" plagiarisms. Do not attempt plagiarism in any form.
You really cannot escape my catch. Just don't try plagiarism in any form.
### Programming assignments (40%) ### Programming assignments (40%)
- We'll announce **all** assignments before the semester begins. - All assignments will be announced at the start of the semester.
- Submit your solution to <https://gg.kaist.ac.kr/course/17>. - Submit your solutions to <https://gg.kaist.ac.kr/course/20>.
- You are **permitted** to use ChatGPT or other LLMs.
- For the concepts that don't come out in prerequisite courses, we tried to comment on the relevant resources in the assignment code. Please read them carefully.
- **How to submit your assignment:** - **How to submit your assignment:**
- To submit your solution, you should run `submit.sh` in `scripts` directory. In other words, you should run the following command: - To submit your solution, you should run `submit.sh` in `scripts` directory. In other words, you should run the following command:
```bash ```bash
# Run this command at the root directory of this repository. # Run this command at the root directory of this repository.
$ ./scripts/submit.sh $ ./scripts/submit.sh
``` ```
- After running the command above, in the `target` directory, you can find a `assignment<NUMBER>.zip` file (`assignment09.zip` for example). Submit this file to <https://gg.kaist.ac.kr/course/17>. - After running the command above, in the `target` directory, you can find a `assignment<NUMBER>.zip` file (`assignment09.zip` for example). Submit this file to <https://gg.kaist.ac.kr/course/20>.
- Read the documentation at <https://cp.kaist.ac.kr/cs220/cs220/>. - Read the documentation at <https://cp.kaist.ac.kr/cs220/cs220/>.
- You can check your grade of each assignment by running the grading script. - You can check your grade of each assignment by running the grading script.
- You can run the grading script with the following command: - You can run the grading script with the following command:
@@ -154,18 +140,19 @@ Make sure that you're capable of using the following development tools:
# E.g. To grade `assignment09`, run the following command: # E.g. To grade `assignment09`, run the following command:
$ ./scripts/grade.sh 9 $ ./scripts/grade.sh 9
``` ```
- You're **allowed** to use ChatGPT or other LLMs. Instead, you'll solve more problems than previous semesters.
### Midterm and final exams (60%) ### Midterm and final exams (60%)
- Date & Time: Oct 18 (midterm) and Dec 13 (final), 13:00pm-15:45pm (or shorter, TBA) - Dates & Times: Oct 23th (Wed), Dec 18th (Wed), 13:00-15:45 (or shorter, TBA)
- Place: Rm. 304, Bldg. E11, KAIST - Location: (the same as usual)
- Your physical apperance is required. If online participation is **absolutely necessary**, we'll use Zoom. - Physical attendance is required.
If necessary, online participation via Zoom will be accommodated.
- You should bring your own laptop. (You can also borrow one from School of Computing Admin Team.) - You are expected to bring your own laptop.
Laptops can also be borrowed from the School of Computing Administration Team.
- We will use [Safe Exam Browser](https://safeexambrowser.org/) to prevent cheatings. - We will use [Safe Exam Browser](https://safeexambrowser.org/) to prevent cheatings.
- You should have your laptop configured with Safe Exam Browser before the exam. - You should have your laptop configured with Safe Exam Browser before the exam.
@@ -173,7 +160,11 @@ Make sure that you're capable of using the following development tools:
### Attendance (?%) ### Attendance (?%)
- You should solve a quiz at the [Course Management](https://gg.kaist.ac.kr/course/17) website for each session. **You should answer the quiz by the end of the day.** - A quiz must be completed on the [Course Management](https://gg.kaist.ac.kr/course/20) website for each session (if any).
**Quizzes should be completed by the end of the day.**
- Failing to attend a significant number of sessions will result in an automatic grade of F.
ach session. **You should answer the quiz by the end of the day.**
- If you miss a significant number of sessions, you'll automatically get an F. - If you miss a significant number of sessions, you'll automatically get an F.
@@ -182,57 +173,49 @@ Make sure that you're capable of using the following development tools:
### Registration ### Registration
- Make sure you can log in the [lab submission website](https://gg.kaist.ac.kr). - Ensure your ability to log into the [lab submission website](https://gg.kaist.ac.kr).
+ Use your `kaist-cp-class` account for login.
+ Log in with your `kaist-cp-class` account. + Your ID is your `@kaist.ac.kr` email address.
+ Reset your password here: [https://auth.fearless.systems/if/flow/default-recovery-flow/](https://auth.fearless.systems/if/flow/default-recovery-flow/)
+ Your id is your `@kaist.ac.kr` email address. + Contact the instructor if login issues arise.
+ Reset your password here: https://auth.fearless.systems/if/flow/default-recovery-flow/
+ If you cannot log in, please contact the instructor.
### Rules ### Rules
- Course-related announcements and information will be posted on the - Course-related announcements and information will be posted on the [course website](https://github.com/kaist-cp/cs220) and the [GitHub issue tracker](https://github.com/kaist-cp/cs220/issues).
[website](https://github.com/kaist-cp/cs220) as well as on the [GitHub issue It is expected that you read all announcements within 24 hours of their posting.
tracker](https://github.com/kaist-cp/cs220/issues). You are expected to read all Watching the repository is highly recommended for automatic email notifications of new announcements.
announcements within 24 hours of their being posted. It is highly recommended to watch the
repository so that new announcements will automatically be delivered to your email address.
- Ask questions on course materials and assignments in [this repository's issue tracker](https://github.com/kaist-cp/cs220/issues). - Questions about course materials and assignments should be posted in [the course repository's issue tracker](https://github.com/kaist-cp/cs220/issues).
+ Don't send emails to the instructor or TAs for course materials and assignments. + Avoid sending emails to the instructor or TAs regarding course materials and assignments.
+ Before asking a question, ask it to [ChatGPT](https://chat.openai.com/). Or search for it in Google and Stack Overflow. + Research your question using Google, Stack Overflow, and ChatGPT before posting.
+ Describe your question in as much detail as possible. It should include the following things: + Describe your question in detail, including:
* Environment (OS, gcc, g++ version, and any other related program information). * Environment (OS, Rust version, and other relevant program information).
* Command(s) that you used and the result. Any logs should be formatted in code. Refer to [this](https://guides.github.com/features/mastering-markdown/). * Used commands and their results, with logs formatted in code.
* Any directory or file changes you've made. If it is the solution file, just describe which part of the code is modified. See [this guide](https://guides.github.com/features/mastering-markdown/).
* Googling result. Search before asking, and share the keyword used for searching and what you've learned from it. * Any changes made to directories or files.
+ Give a proper title to your issue. For solution files, describe the modified code sections.
+ Read [this](https://github.com/kaist-cp/cs220#communication) for more instructions. * Your Google search results, including search terms and learned information.
+ Questions will be answered within 2 days mostly. + Use a clear and descriptive title for your issue.
+ For further instructions, read [this section](https://github.com/kaist-cp/cs220#communication) on the course website.
+ The requirement to ask questions online first is twofold: It ensures clarity in your query and allows everyone to benefit from shared questions and answers.
+ I'm requiring you to ask questions online first for two reasons. First, clearly writing a - Email inquiries should be reserved for confidential or personal matters.
question is the first step to reaching an answer. Second, you can benefit from the questions and answers of other students. Questions not adhering to this guideline (e.g., course material queries via email) will not be addressed.
- Ask your questions via email **only if** they are either confidential or personal. Any questions - Office hours will not cover *new* questions.
failing to do so (e.g. email questions on course materials) will not be answered. Check the issue tracker for similar questions before attending.
If your question is not listed, post it as a new issue for discussion.
Office hour discussions will focus on unresolved issues.
- We are NOT going to discuss *new* questions during office hours. Before coming to the office - Emails to the instructor or head TA should start with "CS492(uarch):" in the subject line, followed by a brief description.
hour, please check if there is a similar question on the issue tracker. If there isn't, file a new Include your name and student number in the email.
issue and start discussion there. The agenda of the office hour will be the issues that are not Emails lacking this information (e.g., those without a student number) will not receive a response.
resolved yet.
- Emails to the instructor or the head TA should begin with "CS220:" in the subject line, followed - If attending remotely via Zoom (https://kaist.zoom.us/my/jeehoon.kang), set your Zoom name to `<your student number> <your name>` (e.g., `20071163 강지훈`).
by a brief description of the purpose of your email. The content should at least contain your name Instructions for changing your Zoom name can be found [here](https://support.zoom.us/hc/en-us/articles/201363203-Customizing-your-profile).
and student number. Any emails failing to do so (e.g. emails without student number) will not be
answered.
- If you join the session remotely from Zoom (https://kaist.zoom.us/my/jeehoon.kang), - The course is conducted in English.
your Zoom name should be `<your student number> <your name>` (e.g., `20071163 강지훈`). However, you may ask questions in Korean, which will be translated into English.
Change your name by referring to [this](https://support.zoom.us/hc/en-us/articles/201363203-Customizing-your-profile).
- This course is conducted in English. But you may ask questions in Korean. Then I will translate it to English.
## Ignore ## Ignore

View File

@@ -1 +0,0 @@
1.71.0

3
rust-toolchain.toml Normal file
View File

@@ -0,0 +1,3 @@
[toolchain]
channel = "1.80.0"
components = [ "rustfmt", "clippy" ]

View File

@@ -98,7 +98,7 @@ mod test {
#[test] #[test]
fn test_range_iter() { fn test_range_iter() {
let one_to_tens = vec![ let one_to_tens = [
vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10], vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
range(Endpoint::Inclusive(1), Endpoint::Inclusive(10), 1).collect(), range(Endpoint::Inclusive(1), Endpoint::Inclusive(10), 1).collect(),
range(Endpoint::Exclusive(0), Endpoint::Inclusive(10), 1).collect(), range(Endpoint::Exclusive(0), Endpoint::Inclusive(10), 1).collect(),
@@ -107,7 +107,7 @@ mod test {
]; ];
assert!(one_to_tens.iter().all_equal()); assert!(one_to_tens.iter().all_equal());
let ten_to_ones = vec![ let ten_to_ones = [
vec![10, 9, 8, 7, 6, 5, 4, 3, 2, 1], vec![10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
range(Endpoint::Inclusive(10), Endpoint::Inclusive(1), -1).collect(), range(Endpoint::Inclusive(10), Endpoint::Inclusive(1), -1).collect(),
range(Endpoint::Exclusive(11), Endpoint::Inclusive(1), -1).collect(), range(Endpoint::Exclusive(11), Endpoint::Inclusive(1), -1).collect(),
@@ -129,7 +129,7 @@ mod test {
]; ];
assert!(five_evens.iter().all_equal()); assert!(five_evens.iter().all_equal());
let emptys = vec![ let emptys = [
vec![], vec![],
range(Endpoint::Inclusive(2), Endpoint::Inclusive(10), -1).collect(), range(Endpoint::Inclusive(2), Endpoint::Inclusive(10), -1).collect(),
range(Endpoint::Inclusive(10), Endpoint::Inclusive(-100), 1).collect(), range(Endpoint::Inclusive(10), Endpoint::Inclusive(-100), 1).collect(),

View File

@@ -181,37 +181,22 @@ mod test {
#[test] #[test]
fn test_natural_join() { fn test_natural_join() {
let row1: Vec<String> = vec!["20230001", "Jack"] let row1: Vec<String> = ["20230001", "Jack"].iter().map(|s| s.to_string()).collect();
.iter() let row2: Vec<String> = ["20231234", "Mike"].iter().map(|s| s.to_string()).collect();
.map(|s| s.to_string())
.collect();
let row2: Vec<String> = vec!["20231234", "Mike"]
.iter()
.map(|s| s.to_string())
.collect();
let table1 = vec![row1, row2]; let table1 = vec![row1, row2];
let row1: Vec<String> = vec!["20230001", "CS"] let row1: Vec<String> = ["20230001", "CS"].iter().map(|s| s.to_string()).collect();
.iter() let row2: Vec<String> = ["20230001", "EE"].iter().map(|s| s.to_string()).collect();
.map(|s| s.to_string()) let row3: Vec<String> = ["20231234", "ME"].iter().map(|s| s.to_string()).collect();
.collect();
let row2: Vec<String> = vec!["20230001", "EE"]
.iter()
.map(|s| s.to_string())
.collect();
let row3: Vec<String> = vec!["20231234", "ME"]
.iter()
.map(|s| s.to_string())
.collect();
let table2 = vec![row1, row2, row3]; let table2 = vec![row1, row2, row3];
let row1: Vec<String> = vec!["20230001", "Jack", "CS"] let row1: Vec<String> = ["20230001", "Jack", "CS"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row2: Vec<String> = vec!["20230001", "Jack", "EE"] let row2: Vec<String> = ["20230001", "Jack", "EE"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row3: Vec<String> = vec!["20231234", "Mike", "ME"] let row3: Vec<String> = ["20231234", "Mike", "ME"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
@@ -222,61 +207,58 @@ mod test {
HashSet::<Vec<String>>::from_iter(table3) HashSet::<Vec<String>>::from_iter(table3)
); );
let row1: Vec<String> = vec!["20230001", "Alice"] let row1: Vec<String> = ["20230001", "Alice"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row2: Vec<String> = vec!["20230002", "Bob"] let row2: Vec<String> = ["20230002", "Bob"].iter().map(|s| s.to_string()).collect();
let row3: Vec<String> = ["20230003", "Charlie"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row3: Vec<String> = vec!["20230003", "Charlie"] let row4: Vec<String> = ["20230004", "David"]
.iter()
.map(|s| s.to_string())
.collect();
let row4: Vec<String> = vec!["20230004", "David"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let table1 = vec![row1, row2, row3, row4]; let table1 = vec![row1, row2, row3, row4];
let row1: Vec<String> = vec!["20230001", "Apple"] let row1: Vec<String> = ["20230001", "Apple"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row2: Vec<String> = vec!["20230001", "Avocado"] let row2: Vec<String> = ["20230001", "Avocado"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row3: Vec<String> = vec!["20230002", "Banana"] let row3: Vec<String> = ["20230002", "Banana"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row4: Vec<String> = vec!["20230002", "Berries"] let row4: Vec<String> = ["20230002", "Berries"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row5: Vec<String> = vec!["20230004", "Durian"] let row5: Vec<String> = ["20230004", "Durian"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let table2 = vec![row1, row2, row3, row4, row5]; let table2 = vec![row1, row2, row3, row4, row5];
let row1: Vec<String> = vec!["20230001", "Alice", "Apple"] let row1: Vec<String> = ["20230001", "Alice", "Apple"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row2: Vec<String> = vec!["20230001", "Alice", "Avocado"] let row2: Vec<String> = ["20230001", "Alice", "Avocado"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row3: Vec<String> = vec!["20230002", "Bob", "Banana"] let row3: Vec<String> = ["20230002", "Bob", "Banana"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row4: Vec<String> = vec!["20230002", "Bob", "Berries"] let row4: Vec<String> = ["20230002", "Bob", "Berries"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();
let row5: Vec<String> = vec!["20230004", "David", "Durian"] let row5: Vec<String> = ["20230004", "David", "Durian"]
.iter() .iter()
.map(|s| s.to_string()) .map(|s| s.to_string())
.collect(); .collect();

View File

@@ -10,7 +10,6 @@
#![deny(macro_use_extern_crate)] #![deny(macro_use_extern_crate)]
#![deny(missing_debug_implementations)] #![deny(missing_debug_implementations)]
#![deny(non_ascii_idents)] #![deny(non_ascii_idents)]
#![deny(pointer_structural_match)]
#![deny(rust_2018_idioms)] #![deny(rust_2018_idioms)]
#![deny(trivial_numeric_casts)] #![deny(trivial_numeric_casts)]
// #![deny(unused_crate_dependencies)] // TODO: uncomment // #![deny(unused_crate_dependencies)] // TODO: uncomment