[Rust] Native binary search solution
rust\nuse std::cmp::Ordering;\n\nimpl Solution {\n    pub fn successful_pairs(spells: Vec<i32>, mut potions: Vec<i32>, success: i64) -> Vec<i32> {\n        let 
```rust\nuse std::cmp::Ordering;\n\nimpl Solution {\n    pub fn successful_pairs(spells: Vec<i32>, mut potions: Vec<i32>, success: i64) -> Vec<i32> {\n        let num_potions = potions.len() as i32;\n        potions.sort_unstable();\n\n        let mut result = vec![0; spells.len()];\n\n        for (i, spell) in spells.into_iter().enumerate() {\n            let left = potions\n                .binary_search_by(|&potion| match (potion as i64 * spell as i64).cmp(&success) {\n                    Ordering::Less => Ordering::Less,\n                    // treat equal element as greater so that the BS will always terminate with\n                    // Error() containing the index of element that is greater or equal to one we\n                    // searched for\n                    Ordering::Equal => Ordering::Greater,\n                    Ordering::Greater => Ordering::Greater,\n                })\n                .unwrap_err() as i32;\n\n            result[i] = (num_potions - left) as i32;\n        }\n\n        result\n    }\n}\n```\n\nBinary search example:\n\n```rust\n#[test]\nfn test6() {\n\t// 4 is missing\n\tlet sample = vec![1, 2, 3, 5, 6, 7, 7];\n\tlet left = sample\n\t\t.binary_search_by(|&potion| match potion.cmp(&4) {\n\t\t\tOrdering::Less => Ordering::Less,\n\t\t\tOrdering::Equal => Ordering::Greater,\n\t\t\tOrdering::Greater => Ordering::Greater,\n\t\t})\n\t\t.unwrap_err();\n\tassert_eq!(sample[left], 5);\n\n\tlet left = sample\n\t\t.binary_search_by(|&potion| match potion.cmp(&3) {\n\t\t\tOrdering::Less => Ordering::Less,\n\t\t\tOrdering::Equal => Ordering::Greater,\n\t\t\tOrdering::Greater => Ordering::Greater,\n\t\t})\n\t\t.unwrap_err();\n\tassert_eq!(sample[left], 3);\n}\n```\n\nEquivalent for:\n\n```rust\nimpl Solution {\n    pub fn successful_pairs(spells: Vec<i32>, mut potions: Vec<i32>, success: i64) -> Vec<i32> {\n        let num_potions = potions.len();\n        potions.sort_unstable();\n\n        let mut result = vec![0; spells.len()];\n\n        for (i, spell) in spells.into_iter().enumerate() {\n            let mut left = 0;\n            let mut right = num_potions;\n\n            while left < right {\n                let mid = left + (right - left) / 2;\n                if spell as i64 * potions[mid] as i64 >= success {\n                    right = mid;\n                } else {\n                    left = mid + 1;\n                }\n            }\n\n            result[i] = (num_potions - left) as i32;\n        }\n\n        result\n    }\n}\n```
['Binary Tree', 'Rust']