{"id":17609876,"url":"https://github.com/emmiegit/rust-ref-map","last_synced_at":"2025-09-08T09:40:43.068Z","repository":{"id":57659324,"uuid":"236270391","full_name":"emmiegit/rust-ref-map","owner":"emmiegit","description":"Helper trait with convenience methods for mapping references of Option and Result.","archived":false,"fork":false,"pushed_at":"2023-03-19T04:24:18.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T15:10:42.521Z","etag":null,"topics":["borrowing","references","rust","traits"],"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/emmiegit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-01-26T05:18:24.000Z","updated_at":"2023-09-08T18:02:42.000Z","dependencies_parsed_at":"2024-01-13T04:21:47.285Z","dependency_job_id":null,"html_url":"https://github.com/emmiegit/rust-ref-map","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"8e2197de64babf58c88275c11cd424c12e6792e1"},"previous_names":["ammongit/rust-ref-map"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/emmiegit/rust-ref-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Frust-ref-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Frust-ref-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Frust-ref-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Frust-ref-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmiegit","download_url":"https://codeload.github.com/emmiegit/rust-ref-map/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmiegit%2Frust-ref-map/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166521,"owners_count":25233958,"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-08T02:00:09.813Z","response_time":121,"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":["borrowing","references","rust","traits"],"created_at":"2024-10-22T17:10:27.713Z","updated_at":"2025-09-08T09:40:43.021Z","avatar_url":"https://github.com/emmiegit.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ref-map\n\n[![Build Status](https://travis-ci.org/emmiegit/rust-ref-map.svg?branch=master)](https://travis-ci.org/emmiegit/rust-ref-map)\n\nRust crate for convenience traits on `Option\u003cT\u003e` and `Result\u003cT, E\u003e`.\n\nHas no dependencies, and should work on any Rust release channel.\n\nThree methods are provided, `ref_map()` for `Some(_)` and `Ok(_)`, and `ref_map_err()` for `Err(_)`.\nThis allows easily mapping borrowed values from maybe values.\n\n```rust\nuse ref_map::*;\n\nlet string: Option\u003cString\u003e = Some(\"hello world\\n\".into());\n\n// Without ref-map:\n// the .as_ref() is necessary because otherwise it tries to consume the String\nlet message: Option\u003c\u0026str\u003e = string.as_ref().map(|s| s.trim());\n\n// With ref-map:\nlet message: Option\u003c\u0026str\u003e = string.ref_map(|s| s.trim());\n```\n\n`ref_map()` is also provided for `Result\u003cT, E\u003e` for `Ok`, and `ref_map_err()` for `Err`.\n\n----\n\nCopyright (C) 2020-2021 Ammon Smith\n\nAvailable under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmiegit%2Frust-ref-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmiegit%2Frust-ref-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmiegit%2Frust-ref-map/lists"}