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: lib.rs
    path of file: ./repos/swc/crates/swc_html_minifier/src
    
    the code of the file until where you have to start completion: #![deny(clippy::all)]

use std::{borrow::Cow, cmp::Ordering, mem::take};

use once_cell::sync::Lazy;
use serde_json::Value;
use swc_atoms::{js_word, JsWord};
use swc_cached::regex::CachedRegex;
use swc_common::{
    collec
    
    fn collapse_whitespace<'a>(&self, data: &'a str) -> Cow<'a, str> {
        if data.is_empty() {
            return Cow::Borrowed(data);
        }

        if data.chars().all(|c| !matches!(c, c if is_whitespace(c))) {
            return Cow::Borrowed(data);
        }

        let mut collapsed = String::with_capacity(data.len());
        let mut in_whitespace = false;

        for c in data.chars() {
            if is_whitespace(c) {
                if in_whitespace {
                    // Skip this character.
                    continue;
                };

                in_whitespace = true;

                collapsed.push(' ');
            } else {
                in_whitespace = false;

                collapsed.push(c);
            };
        }

        Cow::Owned(collapsed)
    }