Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xaeroxe/platform
Repo for the Rust `platform` crate.
https://github.com/xaeroxe/platform
Last synced: 3 months ago
JSON representation
Repo for the Rust `platform` crate.
- Host: GitHub
- URL: https://github.com/xaeroxe/platform
- Owner: Xaeroxe
- License: apache-2.0
- Created: 2018-04-27T21:45:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-31T19:57:02.000Z (almost 6 years ago)
- Last Synced: 2024-10-31T12:09:11.273Z (3 months ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 22
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# platform crate [![Crates listing](https://img.shields.io/crates/v/platform.svg)](https://crates.io/crates/platform) [![Travis](https://travis-ci.com/Xaeroxe/platform.svg?branch=master)](https://travis-ci.com/Xaeroxe/platform)
This crate provides an easy way to inline selection of input parameters
based on the platform being targeted. Can be used on any `Sized` type.This is guaranteed to be a zero cost abstraction, as all calls are inlined.
```rust
extern crate platform;use platform::Platform;
fn main() {
println!("Hello from {}!",
"unknown"
.ios("ios")
.android("android")
.windows("windows")
.macos("macos")
.linux("linux")
.wasm32("wasm32")
.emscripten("emscripten")
);
}
```# Contributing
I welcome contributions and alterations to this project! [Here's some info to help you get started.](https://help.github.com/articles/about-pull-requests/)
- If you would consider your change substantial open an issue on the issues tab so we can discuss it before you build it.
- If you're fixing a bug please provide a unit test for the bug fixed so we don't do it again.
- If applicable, new features should have some basic unit tests added too.
- Please format your code with the most recent stable release of rustfmt before submitting your PR.
- I don't have a regular release schedule, if you want something you've added put on crates.io right away make sure to
bump the version number for the project in your pull request.