{"id":19448815,"url":"https://github.com/suhanyujie/hello_cargo","last_synced_at":"2026-06-19T05:32:27.173Z","repository":{"id":38339135,"uuid":"166200510","full_name":"suhanyujie/hello_cargo","owner":"suhanyujie","description":"Rust 的 hello world","archived":false,"fork":false,"pushed_at":"2023-07-20T22:52:03.000Z","size":239,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T09:17:58.220Z","etag":null,"topics":["rust-study"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhanyujie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-17T09:42:15.000Z","updated_at":"2020-10-11T01:11:23.000Z","dependencies_parsed_at":"2024-11-10T16:40:48.779Z","dependency_job_id":null,"html_url":"https://github.com/suhanyujie/hello_cargo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suhanyujie/hello_cargo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fhello_cargo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fhello_cargo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fhello_cargo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fhello_cargo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhanyujie","download_url":"https://codeload.github.com/suhanyujie/hello_cargo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fhello_cargo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34519049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust-study"],"created_at":"2024-11-10T16:28:39.871Z","updated_at":"2026-06-19T05:32:27.143Z","avatar_url":"https://github.com/suhanyujie.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello Rust/Cargo\n\n## index\n* [字符串](./src/study/string.rs)\n* [Option 枚举](./src/study/option.rs)\n* [hashmap](./src/study/hashmap.rs)\n* [match](./src/study/match.rs)\n* [所有权](./src/study/ownership.rs)\n* [迭代器](./src/study/iterator.rs)\n* [闭包](./src/study/closures.rs)\n* [生命周期](./src/study/lifetime.rs)\n* [trait](./src/study/trait.rs)\n* [线程](./src/study/thread.rs)\n\n### 其他\n* 一些测试代码(src/test_code/t1.rs)\n* Rust 中的字串处理(src/rs_string)\n\n## Usage\n\n### build\n* `rustc src/study/ownership.rs -o a.out`\n\n### run\n* `./a.out`\n* 编译并运行\n    * 以 ownership.rs  文件为例：`./run.sh src/study/ownership.rs`\n\n## 知识点 todo\n\n### 所有权\n* 在堆上创建字符串：`let str1 = String::from(\"hello world\")`\n\n## example app\n### try my first app in rust\n* 根据博文[building-a-command-line-todo-app-in-rust](https://medium.com/@devashishdxt/building-a-command-line-todo-app-in-rust-a89bb7af91c3)进行代码编写\n\n#### 流程\n* 每个事项有一个id和一个名称\n* 当我们新增一个事项，会将其写入`todos/pending.todo`文件中，这个文件包含了所有“进行中”事项的数组，这个数组使用`bincode`编码。\n* `todos/counter.todo`这个文件包含了最新使用的主键id，它是为了给新创建的事项分配一个唯一的id，当新增一个事项时，会将这个数组递增并存入这个文件中。\n* 无论何时，用户标记事项已经完成是，将会将事项从`todos/pending.todo`中移除，并将其写入到`todos/completed.todo`文件中，`todos/completed.todo`中包含了所有的已完成事项的数组。\n\n## 百坑全书\n* 代码块中的调用语句，“加分号”和“不加分号”返回的结果截然不同\n* 一个`rs`文件中，如果存在不会调用的函数，可以通过在函数上方添加`#[allow(dead_code)]`注解或者`#[test]`，让编译器不在提示warning。\n\n## 参考资料\n* 社区电子书 https://kaisery.github.io/trpl-zh-cn/\n* https://medium.com/@devashishdxt/building-a-command-line-todo-app-in-rust-a89bb7af91c3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhanyujie%2Fhello_cargo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhanyujie%2Fhello_cargo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhanyujie%2Fhello_cargo/lists"}