commit | 503c4fdb9800b3ef2aa63eda7d8a0333906bc916 | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Wed Aug 28 22:18:45 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Aug 28 22:18:45 2024 +0000 |
tree | 652d027ccf2b62b84f6b5416a61fb5ff04a83153 | |
parent | 29aef0075969adea5a53f957da81c738f4d236c5 [diff] | |
parent | f98dc25f5c5c846e60973323b32bf88b6a7e89d4 [diff] |
Migrate 25 crates to monorepo. am: f98dc25f5c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/mime/+/3248512 Change-Id: Icb024db87bd48378a5bc570fdad0ed6938c187ea Signed-off-by: Automerger Merge Worker <[email protected]>
Support MIME (Media Types) as strong types in Rust.
extern crate mime; // common types are constants let text = mime::TEXT_PLAIN; // deconstruct Mimes to match on them match (text.type_(), text.subtype()) { (mime::TEXT, mime::PLAIN) => { // plain text! }, (mime::TEXT, _) => { // structured text! }, _ => { // not text! } }