{"id":23189533,"url":"https://github.com/champii/eziter","last_synced_at":"2025-04-05T06:12:57.363Z","repository":{"id":62444670,"uuid":"491725997","full_name":"Champii/eziter","owner":"Champii","description":"Iterators made easy","archived":false,"fork":false,"pushed_at":"2022-06-14T11:41:04.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T12:40:03.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Champii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-13T02:00:42.000Z","updated_at":"2022-10-25T07:54:53.000Z","dependencies_parsed_at":"2022-11-01T22:30:44.744Z","dependency_job_id":null,"html_url":"https://github.com/Champii/eziter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Champii%2Feziter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Champii%2Feziter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Champii%2Feziter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Champii%2Feziter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Champii","download_url":"https://codeload.github.com/Champii/eziter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294550,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-18T11:19:54.076Z","updated_at":"2025-04-05T06:12:57.342Z","avatar_url":"https://github.com/Champii.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EzIter\nIterators made easy\n\n## Usage\n\nAdd this line into your `Cargo.toml`\n\n```toml\neziter = \"0.1\"\n```\n\nand add a use statement at the top of every module using `EzIter`\n\n```rust\nuse eziter::*;\n```\n\n## What is this ?\n\nThis crate contains some conveniance wrappers around rust's iterators and std collections.\n\nTheses are essentially useful in the rare cases where you only want to use a single map or\nfilter on your iterator without the syntactic burden of unrolling a full `x.iter().map(f).collect();`.\nYou can instead write a more appeiling `x.map(f);`\n\nOnly a handful of methods are actually implemented, more might come in the future:\n\n```rust\n    x.map(f);\n    x.filter(f);\n    x.filter_map(f);\n    x.skip_while(f);\n    x.take_while(f);\n    x.map_while(f);\n```\n\n\nEach of theses come in 3 flavors, here an example with `map`\n\n```rust\n    x.into_map(f);\n    x.map(f);\n    x.map_mut(f);\n```\n\nThat corresponds to \n\n```rust\n    x.into_iter().map(f).collect();\n    x.iter().map(f).collect();\n    x.iter_mut().map(f).collect();\n```\n\nYou can use theses wrappers out of the box with the standard collections\n\n```rust\n    HashMap\u003cK, V\u003e\n    BTreeMap\u003cK, V\u003e\n    HashSet\u003cK\u003e\n    BTreeSet\u003cK\u003e\n    BinaryHeap\u003cT\u003e\n    LinkedList\u003cT\u003e\n    Vec\u003cT\u003e\n    VecDeque\u003cT\u003e\n```\n\nbut note that the `*_mut()` variations are not available for \n```rust\n    HashSet\u003cK\u003e\n    BTreeSet\u003cK\u003e\n    BinaryHeap\u003cT\u003e\n```\n\nYou also gain usage of all `into_*()` wrappers for every implementors of `IntoIterator`\n\n## Example\n\n```rust\nuse eziter::*;\n\nfn main() {\n    let v = vec![1, 2, 3];\n\n    let _res: Vec\u003c_\u003e = v.map(|x| x + 3);\n}\n```\n\n## Caveats\n\nPlease note that theses wrappers don't come for free.\n\n### No chainable calls\n\nFirst, you will lose the ability to chain theses calls together.\nI mean, you *could* chain them, but they would all individually call the `.collect()` method, \nleaving you with an increasing waste of resources as the chain grows.\nThe rust's Iterators are the way to go in that case, obviously.\n\n### Extra `Box\u003c\u003e` allocation\n\nIn order for the implementation to hold, only the `into_*()` wrappers come really free of charge,\nthe others produced iterators are wrapped around a `Box\u003cdyn Iterator\u003e`. If you don't mind the extra\nallocation/deallocation, you are fine.\nThis might change in the future when rust will allow to return `impl`s from trait implementation.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchampii%2Feziter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchampii%2Feziter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchampii%2Feziter/lists"}