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: _86_partition_list.rs
    path of file: ./repos/rustgym/leetcode/src/d0
    
    the code of the file until where you have to start completion: struct Solution;
use rustgym_util::*;

impl Solution {
    fn partition(mut head: ListLink, x: i32) -> ListLink {
        let mut left: Vec<i32> = vec![];
        let mut right: Vec<i32> = vec![];
        while let Some(node) = head {
            let val = node.val;
            if val < x {
                left.push(val);
            } else {
                right.push(val);
            }
            head = node.next;
        }
        let mut res = None;
        while let Some(val) = rig
    
    fn partition(mut head: ListLink, x: i32) -> ListLink {
        let mut left: Vec<i32> = vec![];
        let mut right: Vec<i32> = vec![];
        while let Some(node) = head {
            let val = node.val;
            if val < x {
                left.push(val);
            } else {
                right.push(val);
            }
            head = node.next;
        }
        let mut res = None;
        while let Some(val) = right.pop() {
            res = ListLink::link(val, res);
        }
        while let Some(val) = left.pop() {
            res = ListLink::link(val, res);
        }
        res
    }