{"id":18812203,"url":"https://github.com/blobfolio/trimothy","last_synced_at":"2025-04-13T21:10:53.017Z","repository":{"id":57663755,"uuid":"480551319","full_name":"Blobfolio/trimothy","owner":"Blobfolio","description":"Rust traits for trimming slices, vecs, and strings.","archived":false,"fork":false,"pushed_at":"2025-02-26T03:29:18.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T13:45:52.730Z","etag":null,"topics":["rust","slice-trimming","string-trimming","whitespace-normalization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blobfolio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"Blobfolio"}},"created_at":"2022-04-11T21:04:45.000Z","updated_at":"2025-02-26T03:28:09.000Z","dependencies_parsed_at":"2025-02-26T04:22:19.395Z","dependency_job_id":"57406c6c-5ae4-4b8c-b8aa-e934bc824812","html_url":"https://github.com/Blobfolio/trimothy","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"7d19e80e19a43a767e2d065035879754b4c824bf"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Ftrimothy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Ftrimothy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Ftrimothy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blobfolio%2Ftrimothy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blobfolio","download_url":"https://codeload.github.com/Blobfolio/trimothy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782261,"owners_count":21160717,"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":["rust","slice-trimming","string-trimming","whitespace-normalization"],"created_at":"2024-11-07T23:30:30.969Z","updated_at":"2025-04-13T21:10:52.994Z","avatar_url":"https://github.com/Blobfolio.png","language":"Rust","funding_links":["https://github.com/sponsors/Blobfolio"],"categories":[],"sub_categories":[],"readme":"# Trimothy\n\n[![docs.rs](https://img.shields.io/docsrs/trimothy.svg?style=flat-square\u0026label=docs.rs)](https://docs.rs/trimothy/)\n[![changelog](https://img.shields.io/crates/v/trimothy.svg?style=flat-square\u0026label=changelog\u0026color=9b59b6)](https://github.com/Blobfolio/trimothy/blob/master/CHANGELOG.md)\u003cbr\u003e\n[![crates.io](https://img.shields.io/crates/v/trimothy.svg?style=flat-square\u0026label=crates.io)](https://crates.io/crates/trimothy)\n[![ci](https://img.shields.io/github/actions/workflow/status/Blobfolio/trimothy/ci.yaml?style=flat-square\u0026label=ci)](https://github.com/Blobfolio/trimothy/actions)\n[![deps.rs](https://deps.rs/repo/github/blobfolio/trimothy/status.svg?style=flat-square\u0026label=deps.rs)](https://deps.rs/repo/github/blobfolio/trimothy)\u003cbr\u003e\n[![license](https://img.shields.io/badge/license-wtfpl-ff1493?style=flat-square)](https://en.wikipedia.org/wiki/WTFPL)\n[![contributions welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\u0026label=contributions)](https://github.com/Blobfolio/trimothy/issues)\n\nTrimothy is a small library that expands on the limited String- and slice-trimming capabilities provided by the standard library.\n\nIf any of these methods happened to be introduced into stable Rust in the future, they will simply be removed from here.\n\nThis crate is `#![no_std]`-compatible.\n\n\n\n### TrimSliceMatches\n\nThis trait adds the arbitrary, match-based trimming methods to `\u0026[u8]`, `Vec\u003cu8\u003e`, and `Box\u003c[u8]\u003e`:\n\n| Method | Description |\n| ------ | ----------- |\n| `trim_matches` | Trim arbitrary leading and trailing bytes. |\n| `trim_start_matches` | Trim arbitrary leading bytes. |\n| `trim_end_matches` | Trim arbitrary trailing bytes. |\n\nEach of these match methods accept either:\n* A single `u8`;\n* An array or slice of `u8`;\n* A `\u0026BtreeSet\u003cu8\u003e`\n* A custom callback with signature `Fn(u8) -\u003e bool`\n\n\n### TrimMut\n\nThis trait brings _mutable_ trimming support to `String`, `Vec\u003cu8\u003e`, and `Box\u003c[u8]\u003e`.\n\n| Method | Description |\n| ------ | ----------- |\n| `trim_mut` | Trim leading and trailing whitespace (mutably). |\n| `trim_start_mut` | Trim leading whitespace (mutably). |\n| `trim_end_mut` | Trim trailing whitespace (mutably). |\n\n\n### TrimMatchesMut\n\nThis trait brings _mutable_ match-based trimming `String`, `Vec\u003cu8\u003e`, and `Box\u003c[u8]\u003e`.\n\n| Method | Description |\n| ------ | ----------- |\n| `trim_matches_mut` | Trim arbitrary leading and trailing bytes (mutably). |\n| `trim_start_matches_mut` | Trim arbitrary leading bytes (mutably). |\n| `trim_end_matches_mut` | Trim arbitrary trailing bytes (mutably). |\n\n\nEach of these match methods accept either:\n* A single T;\n* An array or slice of T;\n* A `\u0026BtreeSet\u003cT\u003e`\n* A custom callback with signature `Fn(T) -\u003e bool`\n\nWhere T is `char` for string sources, and `u8` for byte sources.\n\n\n### TrimNormal\n\nThis trait adds a single `trim_and_normalize` method to owned and borrowed string and byte slices that trims leading/trailing whitespace, and compacts/normalizes spans of _inner_ whitespace to a single horizontal space.\n\n| Method | Description |\n| ------ | ----------- |\n| `trim_and_normalize` | Trim, normalize, and return. |\n\nThe `TrimNormalBytes` and `TrimNormalChars` traits can be used to extend\nthis same functionality to arbitrary iterators of `u8` and `char`,\nrespectively.\n\n\n\n## Installation\n\nThe dependency can be added the normal way:\n\n```toml\n[dependencies]\ntrimothy = \"0.7\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblobfolio%2Ftrimothy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblobfolio%2Ftrimothy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblobfolio%2Ftrimothy/lists"}