Rust solution
\nimpl Solution {\n    pub fn maximum_difference(nums: Vec<i32>) -> i32 {\n        let mut diff = -1;\n        let (mut max, mut min) = (nums[0], nums[0]);\n   
```\nimpl Solution {\n    pub fn maximum_difference(nums: Vec<i32>) -> i32 {\n        let mut diff = -1;\n        let (mut max, mut min) = (nums[0], nums[0]);\n        for &val in nums[1..].iter() {\n            if val < min {\n                min = val;\n                max = val;\n            } else if val > max {\n                max = val;\n                diff = diff.max(max - min);\n            }\n        }\n        diff\n    }\n}\n```
['Rust']