fn uniq_(vm: &mut VM, self_val: Value, args: &Args2) -> VMResult {
    args.check_args_num(0)?;
    let mut h = FxHashSet::default();
    let deleted = match &args.block {
        None => {
            let mut aref = self_val.into_array();
            let mut recursive = false;
            aref.retain(|x| {
                if self_val.id() == x.id() {
                    if !recursive {
                        recursive = true;
                        Ok(true)
                    } else {
                        Ok(false)
                    }
                } else {
                    Ok(h.insert(HashKey(*x)))
                }
            })?
        }
        Some(block) => {
            let mut aref = self_val.into_array();
            let f = vm.eval_block_map1(block);
            aref.retain(|x| {
                let res = f(vm, *x)?;
                vm.temp_push(res);
                Ok(h.insert(HashKey(res)))
            })?
        }
    };
    if deleted {
        Ok(self_val)
    } else {
        Ok(Value::nil())
    }
}
## instance method Array#uniq
- uniq! -> self | nil
- uniq! {|item| ... } -> self | nil

https://docs.ruby-lang.org/ja/latest/method/Array/i/uniq.html
ruruby/src/builtin/array.rs