{"id":20556997,"url":"https://github.com/sharpvik/idioma","last_synced_at":"2026-04-11T23:44:34.562Z","repository":{"id":62440494,"uuid":"300835910","full_name":"sharpvik/idioma","owner":"sharpvik","description":"Print Rusty-looking errors.","archived":false,"fork":false,"pushed_at":"2021-01-17T03:51:57.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T06:55:42.336Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharpvik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-03T08:45:55.000Z","updated_at":"2021-01-17T03:51:59.000Z","dependencies_parsed_at":"2022-11-01T21:53:22.590Z","dependency_job_id":null,"html_url":"https://github.com/sharpvik/idioma","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fidioma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fidioma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fidioma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fidioma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharpvik","download_url":"https://codeload.github.com/sharpvik/idioma/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242163857,"owners_count":20082224,"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":[],"created_at":"2024-11-16T03:34:14.550Z","updated_at":"2026-04-11T23:44:29.518Z","avatar_url":"https://github.com/sharpvik.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The `idioma` Library\n\nAs Rust developers we deeply care about safety and error handling - our programs\nare fast and reliable. However, users never make it easy for us: they\nmisunderstand instructions and break things. When we catch them doing something\nthey shouldn't be doing, we let them know (usually) with an error message.\n\nEvery command line tool prints handy messages to `stdout` from time to time, and\nto do so, requires a function or two. I noticed that whenever I start a new\nproject I tend to copy the `util.rs` that contains those display functions from\nmy last project. That is simply no good.\n\nIt means that my error messages\n\n- differ in style (since I regularly alter code in that util file);\n- don't look like idiomatic Rust messages;\n- require that `copy + paste` operation for every new project.\n\nAnd I strongly believe that I am not alone in this. Take a look at\n[this code][1] by [brain-lang]:\n\n```rust\nmacro_rules! exit_with_error(\n    ($($arg:tt)*) =\u003e { {\n        use std::process;\n        eprintln!($($arg)*);\n        process::exit(1);\n    } }\n);\n```\n\n[1]: https://github.com/brain-lang/brainfuck/blob/master/src/bin/brainfuck.rs#L21\n[brain-lang]: https://github.com/brain-lang/\n\nAs you can see, they wrote this macro right next to the `main` function and it\nis the same problem that I have with my util file. The `idioma` library solves\nall these issues forever. Here's how.\n\n## Use me, baby!\n\nIn your `Cargo.toml` file.\n\n```toml\n[dependencies]\nidioma = \"*\"\n```\n\nInclude in any Rust file.\n\n```rust\nextern crate idioma;\n```\n\nUse within a function.\n\n```rust\nfn foo(i: i32) {\n    if i != 42 {\n        error(\"Your taste is appalling.\").exit(1);\n    }\n}\n```\n\n## Development\n\nYou are more than welcome to contribute to this library. Same as always:\n\n- Fork;\n- Change;\n- Pull Request.\n\nI will do my best to review requests as soon as possible. If you write a new\nfunction or something, make sure to include [doc comments] with some of that\nspicy humour!\n\n[doc comments]: https://doc.rust-lang.org/stable/rust-by-example/meta/doc.html\n\nTo see what's already there, visit [docs.rs] where you can see full\ndocumentation with links to source code.\n\n[docs.rs]: https://docs.rs/idioma/\n\n## License\n\nI don't know why, but this code is licensed under the MIT license which means\nthe following:\n\n```\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n---\n\nI know that it's cringe, but I really made it with ❤️ so 😘 bye-bye.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpvik%2Fidioma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharpvik%2Fidioma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpvik%2Fidioma/lists"}