{"id":27162166,"url":"https://github.com/coruscateor/inc_dec","last_synced_at":"2026-02-17T01:01:32.108Z","repository":{"id":283586371,"uuid":"952268612","full_name":"coruscateor/inc_dec","owner":"coruscateor","description":"Incrementation and decrementation in Rust.","archived":false,"fork":false,"pushed_at":"2025-04-01T00:34:17.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T09:43:40.682Z","etag":null,"topics":["decrement","extension","floating-point","increment","integer","rust","rust-lang","rustlang"],"latest_commit_sha":null,"homepage":"https://coruscateor.com/projects/inc-dec","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/coruscateor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-MIT","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":"coruscateor"}},"created_at":"2025-03-21T02:18:59.000Z","updated_at":"2025-04-11T00:09:58.000Z","dependencies_parsed_at":"2025-03-21T02:34:58.172Z","dependency_job_id":"d241bdac-30fa-4adf-a630-115ae071201a","html_url":"https://github.com/coruscateor/inc_dec","commit_stats":null,"previous_names":["coruscateor/inc_dec"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coruscateor/inc_dec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coruscateor%2Finc_dec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coruscateor%2Finc_dec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coruscateor%2Finc_dec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coruscateor%2Finc_dec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coruscateor","download_url":"https://codeload.github.com/coruscateor/inc_dec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coruscateor%2Finc_dec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29528233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T00:57:22.232Z","status":"ssl_error","status_checked_at":"2026-02-17T00:54:25.811Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["decrement","extension","floating-point","increment","integer","rust","rust-lang","rustlang"],"created_at":"2025-04-09T00:59:37.625Z","updated_at":"2026-02-17T01:01:32.085Z","avatar_url":"https://github.com/coruscateor.png","language":"Rust","funding_links":["https://github.com/sponsors/coruscateor"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Inc Dec\n\n[![Crates.io](https://img.shields.io/crates/v/inc_dec)](https://crates.io/crates/inc_dec)\n[![License](https://img.shields.io/badge/license-MIT%2FApache-blue)](#license)\n[![Downloads](https://img.shields.io/crates/d/inc_dec)](https://crates.io/crates/inc_dec)\n[![Docs](https://docs.rs/inc_dec/badge.svg)](https://docs.rs/inc_dec/latest/inc_dec/)\n[![Twitch Status](https://img.shields.io/twitch/status/coruscateor)](https://www.twitch.tv/coruscateor)\n\n[X](https://twitter.com/Coruscateor) | \n[Twitch](https://www.twitch.tv/coruscateor) | \n[Youtube](https://www.youtube.com/@coruscateor) | \n[Mastodon](https://mastodon.social/@Coruscateor) | \n[GitHub](https://github.com/coruscateor) | \n[GitHub Sponsors](https://github.com/sponsors/coruscateor)\n\nIncrementation and decrementation in Rust.\n\n\u003c/div\u003e\n\n## Examples - Extension Traits:\n\nThe pp and mm methods:\n\n```rust\n\n    use inc_dec::IncDecSelf;\n\n    let mut u32_val: u32 = 0;\n\n    assert_eq!(1, u32_val.pp());\n\n    assert_eq!(0, u32_val.mm());\n\n```\n\nThe try_pp and try_mm methods:\n\n```rust\n\n    use inc_dec::IncDecSelf;\n\n    let mut u32_val: u32 = 0;\n\n    assert_eq!(Some(1), u32_val.try_pp());\n\n    assert_eq!(Some(0), u32_val.try_mm());\n\n    assert_eq!(None, u32_val.try_mm());\n\n```\n\n## Examples - Macros:\n\nThe pp macro:\n\n```rust\n\n    use inc_dec::pp;\n\n    let mut int_val = 1;\n\n    pp!(int_val);\n\n    assert_eq!(2, int_val);\n\n```\n\nThe ppf macro:\n\n```rust\n\n    use inc_dec::ppf;\n\n    let mut f32_val: f32 = 1.0;\n\n    ppf!(f32_val);\n\n    assert_eq!(2.0, f32_val);\n\n    let mut f64_val = 1.0;\n\n    ppf!(f64_val);\n\n    assert_eq!(2.0, f64_val);\n\n```\n\nThe mm macro:\n\n```rust\n\n    use inc_dec::mm;\n\n    let mut int_val = 2;\n\n    mm!(int_val);\n\n    assert_eq!(1, int_val);\n\n```\n\nThe mmf macro:\n\n```rust\n\n    use inc_dec::mmf;\n\n    let mut f32_val: f32 = 2.0;\n\n    mmf!(f32_val);\n\n    assert_eq!(1.0, f32_val);\n\n    let mut f64_val = 2.0;\n\n    mmf!(f64_val);\n\n    assert_eq!(1.0, f64_val);\n\n```\n\n\u003c/br\u003e\n\nAside from regular incrementation and decrementation, the following core library integer methods are used (With associated trait method names) in the integer implementations of the IncDecSelf and IntIncDecSelf traits:\n\n| Method | IncDecSelf Method |\n| ------ | ----------- |\n| checked_add | try_pp |\n| checked_sub | try_mm |\n\n| Method | IntIncDecSelf Method |\n| ------ | ----------- |\n| overflowing_add | opp |\n| overflowing_sub | omm |\n| wrapping_add | wpp |\n| wrapping_sub | wmm |\n\n## No-Std\n\nYou don't need it.\n\n## Todo:\n\n- Add more documentation\n- Add more code examples\n- Add more tests\n- Clean-up the code\n- Add support for non-zero integers (core::num).\n\n## Coding Style\n\nThis project uses a coding style that emphasises the use of white space over keeping the line and column counts as low as possible.\n\nSo this:\n\n```rust\n\n# fn bar() {} \n\nfn foo()\n{\n\n    bar();\n\n}\n\n```\n\nNot this:\n\n```rust\n\n# fn bar() {} \n\nfn foo()\n{\n    bar();\n}\n\n```\n\n\u003cbr/\u003e\n\n## License\n\nLicensed under either of:\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](./LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0 (see also: https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0))\n- MIT license ([LICENSE-MIT](./LICENSE-MIT) or http://opensource.org/licenses/MIT (see also: https://www.tldrlegal.com/license/mit-license))\n\nat your discretion\n\n\u003cbr/\u003e\n\n## Contributing\n\nPlease clone the repository and create an issue explaining what feature or features you'd like to add or bug or bugs you'd like to fix and perhaps how you intend to implement these additions or fixes. Try to include details though it doesn't need to be exhaustive and we'll take it from there (dependant on availability).\n\n\u003cbr/\u003e\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoruscateor%2Finc_dec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoruscateor%2Finc_dec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoruscateor%2Finc_dec/lists"}