{"id":16116654,"url":"https://github.com/dpc/convi","last_synced_at":"2025-09-26T11:30:20.344Z","repository":{"id":50631158,"uuid":"519666740","full_name":"dpc/convi","owner":"dpc","description":"Convi - convenient (but safe) conversion (From-like) traits for Rust","archived":false,"fork":false,"pushed_at":"2024-12-28T04:21:06.000Z","size":39,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T08:58:31.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpc.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":"2022-07-31T02:59:00.000Z","updated_at":"2024-12-28T04:21:10.000Z","dependencies_parsed_at":"2025-01-17T02:59:00.515Z","dependency_job_id":"c36a8859-11e0-42f4-816b-e039a297380d","html_url":"https://github.com/dpc/convi","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":"0.19047619047619047","last_synced_commit":"11d562b915e684a7d7c651f196a4ee5a72911a2b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dpc/convi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpc%2Fconvi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpc%2Fconvi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpc%2Fconvi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpc%2Fconvi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpc","download_url":"https://codeload.github.com/dpc/convi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpc%2Fconvi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276728161,"owners_count":25694210,"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","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"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":[],"created_at":"2024-10-09T20:25:11.190Z","updated_at":"2025-09-26T11:30:20.089Z","avatar_url":"https://github.com/dpc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convi - convenient (but safe) conversion (`From`-like) traits for Rust\n\n\nTired of the pain of casting `usize` and other types in Rust safely? This crate is here to help.\n\nBy enabling cargo features on this crate like this:\n\n```norust\nconvi = { version = \"*\", features = [ \"min_target_pointer_width_32\" ] }\n```\n\nyou can mark your code as not compatible with architectures with\npointer size less than 32 bits. This will enable additional infallible `usize`\nconversions like:\n\n```rust,ignore\nuse convi::CastFrom;\n\nfn main() {\n  let some_u32 = 3u32;\n  println!(\"{}\",  usize::cast_from(some_u32));\n}\n```\n\nand display appropriate error message if anyone\ntries to build your code for unsupported architecture.\n\nIn addition, for times where you know that your value\nwill always be smaller than the given type, instead of\n`u32::try_from(some_usize).expect(\"must not fail\")`,\nyou can:\n\n```rust\nuse convi::ExpectFrom;\n\nfn main() {\n  let some_u32 = 3u32;\n  println!(\"{}\",  usize::expect_from(some_u32));\n}\n```\n\n\nZero dependencies, small code, [review it yourself](https://github.com/dpc/convi/blob/master/src/lib.rs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpc%2Fconvi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpc%2Fconvi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpc%2Fconvi/lists"}