Repository: vercel/next.js
File: turbopack/crates/turbopack/src/module_options/mod.rs (Rust)

Code before:
        ConditionItem::Base {
            path,
            content,
            query,
        } => {
            let mut rule_conditions = Vec::new();
            match &path {
                Some(ConditionPath::Glob(glob)) => rule_conditions.push(
                    rule_condition_from_webpack_condition_glob(execution_context, glob).await?,
                ),
                Some(ConditionPath::Regex(regex)) => {
                    rule_conditions.push(RuleCondition::ResourcePathEsRegex(regex.await?));
                }
                None => {}
            }
            match &query {
                Some(ConditionQuery::Constant(value)) => {
                    rule_conditions.push(RuleCondition::ResourceQueryEquals(value.clone().into()));
                }
                Some(ConditionQuery::Regex(regex)) => {
                    rule_conditions.push(RuleCondition::ResourceQueryEsRegex(regex.await?));
                }
                None => {}
            }
            if let Some(content) = content {
                rule_conditions.push(RuleCondition::ResourceContentEsRegex(content.await?));
            }
            RuleCondition::All(rule_conditions)
        }
    })
}

#[turbo_tasks::value(cell = "new", eq = "manual")]
pub struct ModuleOptions {
    pub rules: Vec<ModuleRule>,
}

#[turbo_tasks::value_impl]
impl ModuleOptions {
    #[turbo_tasks::function]
    pub async fn new(
        path: FileSystemPath,
        module_options_context: Vc<ModuleOptionsContext>,
        resolve_options_context: Vc<ResolveOptionsContext>,
    ) -> Result<Vc<ModuleOptions>> {
        let ModuleOptionsContext {
            css: CssOptionsContext { enable_raw_css, .. },
            ref enable_postcss_transform,
            ref enable_webpack_loaders,
            ref rules,
            ..

Review comment (performance):
are we moving the content condition later since it is more expensive to match? maybe add a comment to that effect?
```suggestion
           // Add the content condition last since matching requires a more expensive file read.
            if let Some(content) = content {
```

Code after:
        ConditionItem::Base {
            path,
            content,
            query,
        } => {
            let mut rule_conditions = Vec::new();
            match &path {
                Some(ConditionPath::Glob(glob)) => rule_conditions.push(
                    rule_condition_from_webpack_condition_glob(execution_context, glob).await?,
                ),
                Some(ConditionPath::Regex(regex)) => {
                    rule_conditions.push(RuleCondition::ResourcePathEsRegex(regex.await?));
                }
                None => {}
            }
            match &query {
                Some(ConditionQuery::Constant(value)) => {
                    rule_conditions.push(RuleCondition::ResourceQueryEquals(value.clone().into()));
                }
                Some(ConditionQuery::Regex(regex)) => {
                    rule_conditions.push(RuleCondition::ResourceQueryEsRegex(regex.await?));
                }
                None => {}
            }
            // Add the content condition last since matching requires a more expensive file read.
            if let Some(content) = content {
                rule_conditions.push(RuleCondition::ResourceContentEsRegex(content.await?));
            }
            RuleCondition::All(rule_conditions)
        }
    })
}

#[turbo_tasks::value(cell = "new", eq = "manual")]
pub struct ModuleOptions {
    pub rules: Vec<ModuleRule>,
}

#[turbo_tasks::value_impl]
impl ModuleOptions {
    #[turbo_tasks::function]
    pub async fn new(
        path: FileSystemPath,
        module_options_context: Vc<ModuleOptionsContext>,
        resolve_options_context: Vc<ResolveOptionsContext>,
    ) -> Result<Vc<ModuleOptions>> {
        let ModuleOptionsContext {
            css: CssOptionsContext { enable_raw_css, .. },
            ref enable_postcss_transform,
            ref enable_webpack_loaders,
            ref rules,