{"id":20410895,"url":"https://github.com/mintlu8/mutify","last_synced_at":"2026-05-29T06:31:29.938Z","repository":{"id":216604185,"uuid":"741800937","full_name":"mintlu8/mutify","owner":"mintlu8","description":"Coerse `mut var: T` and `var: \u0026mut T` into `\u0026mut T`","archived":false,"fork":false,"pushed_at":"2024-01-11T06:18:48.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T08:56:46.338Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mintlu8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-11T06:16:31.000Z","updated_at":"2024-01-11T06:16:52.000Z","dependencies_parsed_at":"2024-01-11T06:58:45.556Z","dependency_job_id":"a019bc7a-e14c-4db1-80ac-1641df47878d","html_url":"https://github.com/mintlu8/mutify","commit_stats":null,"previous_names":["mintlu8/mutify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mintlu8/mutify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fmutify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fmutify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fmutify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fmutify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mintlu8","download_url":"https://codeload.github.com/mintlu8/mutify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fmutify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33640627,"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-05-29T02:00:06.066Z","response_time":107,"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-11-15T05:48:59.550Z","updated_at":"2026-05-29T06:31:29.911Z","avatar_url":"https://github.com/mintlu8.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mutify\n\n[![Crates.io](https://img.shields.io/crates/v/mutify.svg)](https://crates.io/crates/mutify)\n[![Docs](https://docs.rs/mutify/badge.svg)](https://docs.rs/mutify/latest/mutify/)\n\nMacro for coercing a `mut var: T` or `var: \u0026mut T` into a `\u0026mut T`.\n\n## Why\n\nA naive apporach would be putting a `\u0026mut` before the expression,\nhowever this doesn't work.\n\n```rust\nlet func = |v: \u0026mut i32| *v += 1;\nlet mut b = 0;\nlet a = \u0026mut b;\n// `a` is not mutable.\nfunc(\u0026mut a);\n```\n\n## Example\n\n```rust\nfn plus_one(n: \u0026mut i32) {\n    *n += 1;\n}\n\nlet mut a = 3;\nplus_one(mutify!(a));\nassert_eq!(a, 4);\n\nlet b = \u0026mut a;\nplus_one(mutify!(b));\nassert_eq!(a, 5);\n```\n\n## Note\n\nA magic function called `__coerce_mut` is used here, don't name your\nfunctions that and you are good!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintlu8%2Fmutify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmintlu8%2Fmutify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintlu8%2Fmutify/lists"}