| 1 | //! This is the Hello World example from the README. |
| 2 | |
| 3 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 4 | fn mainrust-analyzer cargo bimap 0.6.3 main().() { |
| 5 | // A bijective map between letters of the English alphabet and their positions. |
| 6 | let mut alphabet = bimaprust-analyzer cargo bimap 0.6.3 crate/::BiMaprust-analyzer cargo bimap 0.6.3 BiMap#::<char, u8>::newrust-analyzer cargo bimap 0.6.3 hash/impl#[`BiHashMap<L, R>`]new().(); |
| 7 | |
| 8 | alphabet.insertrust-analyzer cargo bimap 0.6.3 hash/impl#[`BiHashMap<L, R, LS, RS>`]insert().('A', 1); |
| 9 | // some letters omitted for brevity |
| 10 | alphabet.insertrust-analyzer cargo bimap 0.6.3 hash/impl#[`BiHashMap<L, R, LS, RS>`]insert().('Z', 26); |
| 11 | |
| 12 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("A is at position {}", alphabet.get_by_leftrust-analyzer cargo bimap 0.6.3 hash/impl#[`BiHashMap<L, R, LS, RS>`]get_by_left().(&'A').unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()); |
| 13 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{} is at position 26", alphabet.get_by_rightrust-analyzer cargo bimap 0.6.3 hash/impl#[`BiHashMap<L, R, LS, RS>`]get_by_right().(&26).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()); |
| 14 | } |