{"id":15398115,"url":"https://github.com/cuviper/eh","last_synced_at":"2025-04-16T01:09:22.914Z","repository":{"id":57623679,"uuid":"209441322","full_name":"cuviper/eh","owner":"cuviper","description":"Convert values to bool, kind of like C, eh?","archived":false,"fork":false,"pushed_at":"2019-09-19T02:12:54.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-16T01:09:15.554Z","etag":null,"topics":["bool","conversion","rust"],"latest_commit_sha":null,"homepage":"","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/cuviper.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}},"created_at":"2019-09-19T02:04:06.000Z","updated_at":"2023-03-18T22:07:50.000Z","dependencies_parsed_at":"2022-08-30T11:41:18.132Z","dependency_job_id":null,"html_url":"https://github.com/cuviper/eh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuviper%2Feh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuviper%2Feh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuviper%2Feh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuviper%2Feh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuviper","download_url":"https://codeload.github.com/cuviper/eh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249178212,"owners_count":21225349,"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":["bool","conversion","rust"],"created_at":"2024-10-01T15:41:03.181Z","updated_at":"2025-04-16T01:09:22.899Z","avatar_url":"https://github.com/cuviper.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eh\n\n[![Latest Version]][crates.io] [![docs]][docs.rs]\n\nConvert values to `bool`, kind of like C, eh?\n\n[`Eh`] roughly follows the implicit conversion rules for [C to `_Bool`][C]\nor [C++ to `bool`][C++], but Rust requires an explicit conversion. Integer\n`0`, floating-point `0.0`, and null pointers are `false`, and all other\nvalues are `true`.\n\n[`Eh`]: https://docs.rs/eh/0.1/eh/trait.Eh.html\n[C]: https://en.cppreference.com/w/c/language/conversion#Boolean_conversion\n[C++]: https://en.cppreference.com/w/cpp/language/implicit_conversion#Boolean_conversions\n\nAs a Rust-specific extension, this is also implemented for `Option\u003cT\u003e` and\n`Result\u003cT, E\u003e`. It returns `true` when the `?` operator would unwrap a `T`\nvalue, and `false` when `?` would cause an early return.\n\n## Exclusions\n\n`Eh` does not implement further boolean conversions of other languages,\nespecially since they're not universal. For example:\n\n- JavaScript converts NaN to `false`, different than C and C++ (and `eh`).\n- JavaScript converts empty `[]` and `{}` to `true`, but in Python they're `false`.\n- Many languages convert empty strings to `false` and non-empty strings to `true`,\n  but `\"0\"` is also `false` in Perl and PHP.\n\n## About\n\nThe name is a play on the [Canadian \"eh\"][eh], turning a declarative\nsentence into a question.\n\n[eh]: https://en.wikipedia.org/wiki/Eh#Canada\n\n## License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in `eh` by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n[Latest Version]: https://img.shields.io/crates/v/eh.svg\n[crates.io]: https://crates.io/crates/eh\n[docs]: https://docs.rs/eh/badge.svg\n[docs.rs]: https://docs.rs/eh/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuviper%2Feh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuviper%2Feh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuviper%2Feh/lists"}