You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: _360_sort_transformed_array.rs
    path of file: ./repos/rustgym/leetcode/src/d3
    
    the code of the file until where you have to start completion: struct Solution;
use std::cmp::Ordering::*;
use std::collections::VecDeque;

impl Solution {
    fn sort_transformed_array(nums: Vec<i32>, a: i32, b: i32, c: i32) -> Vec<i32> {
        match a.cmp(&0) {
            Equal => {
                if b >= 0 {
                    let res: Vec<i32> = nums.into_iter().map(|x| Self::f(x, a, b, c)).collect();
                    res
                } else {
                    let mut res: Vec<i32> = nums.into_iter().map(|x| Self::f(x, a, b, c)).collect();
                    res.reverse();
                    res
                }
            }
            Greater => {
                let mut queue = VecDeque::from(nums);
                let mut res = vec![];
                while queue.len() > 1 {
                    let front = queue.front().unwrap();
                    let back = queue.back().unwrap();
                    let front = Self::f(*front, a, b, c);
                    let back = Self::f(*back, a, b, c);
                    if front > back {
                        queue.pop_front();
                        res.push(front);
                    } else {
                        queue.pop_back();
                        res.push(back);
                    }
                }
                let last = queue.pop_front().unwrap();
                let last = Self::f(last, a, b, c);
                res.push(last);
                res.reverse();
                res
            }
            Less => {
                let mut queue = VecDeque::from(nums);
                let mut res = vec![];
                while queue.len() > 1 {
                    let front = queue.front().unwrap();
                    let back = queue.back().unwrap();
                    let front = Self::f(*front, a, b, c);
                    let back = Self::f(*back, a, b, c);
                    if front < back {
                        queue.pop_front();
                        res.push(front);
                    } else {
                        queue.pop_back();
                        res.push(back);
  
    
    fn sort_transformed_array(nums: Vec<i32>, a: i32, b: i32, c: i32) -> Vec<i32> {
        match a.cmp(&0) {
            Equal => {
                if b >= 0 {
                    let res: Vec<i32> = nums.into_iter().map(|x| Self::f(x, a, b, c)).collect();
                    res
                } else {
                    let mut res: Vec<i32> = nums.into_iter().map(|x| Self::f(x, a, b, c)).collect();
                    res.reverse();
                    res
                }
            }
            Greater => {
                let mut queue = VecDeque::from(nums);
                let mut res = vec![];
                while queue.len() > 1 {
                    let front = queue.front().unwrap();
                    let back = queue.back().unwrap();
                    let front = Self::f(*front, a, b, c);
                    let back = Self::f(*back, a, b, c);
                    if front > back {
                        queue.pop_front();
                        res.push(front);
                    } else {
                        queue.pop_back();
                        res.push(back);
                    }
                }
                let last = queue.pop_front().unwrap();
                let last = Self::f(last, a, b, c);
                res.push(last);
                res.reverse();
                res
            }
            Less => {
                let mut queue = VecDeque::from(nums);
                let mut res = vec![];
                while queue.len() > 1 {
                    let front = queue.front().unwrap();
                    let back = queue.back().unwrap();
                    let front = Self::f(*front, a, b, c);
                    let back = Self::f(*back, a, b, c);
                    if front < back {
                        queue.pop_front();
                        res.push(front);
                    } else {
                        queue.pop_back();
                        res.push(back);
                    }
                }
                let last = queue.pop_front().unwrap();
                let last = Self::f(last, a, b, c);
                res.push(last);
                res
            }
        }
    }