Repository: servo/servo
File: components/shared/constellation/from_script_message.rs (Rust)

Code before:
    #[cfg(feature = "webgpu")]
    /// Create a WebGPU Adapter instance
    RequestAdapter(
        GenericCallback<WebGPUAdapterResponse>,
        wgpu_core::instance::RequestAdapterOptions,
        wgpu_core::id::AdapterId,
    ),
    #[cfg(feature = "webgpu")]
    /// Get WebGPU channel
    GetWebGPUChan(IpcSender<Option<WebGPU>>),
    /// Notify the constellation of a pipeline's document's title.
    TitleChanged(PipelineId, String),
    /// Notify the constellation that the size of some `<iframe>`s has changed.
    IFrameSizes(Vec<IFrameSizeMsg>),
    /// Request results from the memory reporter.
    ReportMemory(GenericCallback<MemoryReportResult>),
    /// Return the result of the evaluated JavaScript with the given [`JavaScriptEvaluationId`].
    FinishJavaScriptEvaluation(
        JavaScriptEvaluationId,
        Result<JSValue, JavaScriptEvaluationError>,
    ),
    /// Forward a keyboard scroll operation from an `<iframe>` to a parent pipeline.
    ForwardKeyboardScroll(PipelineId, KeyboardScroll),
    /// Notify the Constellation of the screenshot readiness of a given pipeline.
    RespondToScreenshotReadinessRequest(ScreenshotReadinessResponse),
    /// Request the constellation to force garbage collection in all `ScriptThread``s.
    TriggerGarbageCollection,
}

impl fmt::Debug for ScriptToConstellationMessage {
    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        let variant_string: &'static str = self.into();
        write!(formatter, "ScriptMsg::{variant_string}")
    }
}


Review comment (suggestion):
```suggestion
    /// Request the constellation to force garbage collection in all `ScriptThread`'s.
```

Code after:
    #[cfg(feature = "webgpu")]
    /// Create a WebGPU Adapter instance
    RequestAdapter(
        GenericCallback<WebGPUAdapterResponse>,
        wgpu_core::instance::RequestAdapterOptions,
        wgpu_core::id::AdapterId,
    ),
    #[cfg(feature = "webgpu")]
    /// Get WebGPU channel
    GetWebGPUChan(IpcSender<Option<WebGPU>>),
    /// Notify the constellation of a pipeline's document's title.
    TitleChanged(PipelineId, String),
    /// Notify the constellation that the size of some `<iframe>`s has changed.
    IFrameSizes(Vec<IFrameSizeMsg>),
    /// Request results from the memory reporter.
    ReportMemory(GenericCallback<MemoryReportResult>),
    /// Return the result of the evaluated JavaScript with the given [`JavaScriptEvaluationId`].
    FinishJavaScriptEvaluation(
        JavaScriptEvaluationId,
        Result<JSValue, JavaScriptEvaluationError>,
    ),
    /// Forward a keyboard scroll operation from an `<iframe>` to a parent pipeline.
    ForwardKeyboardScroll(PipelineId, KeyboardScroll),
    /// Notify the Constellation of the screenshot readiness of a given pipeline.
    RespondToScreenshotReadinessRequest(ScreenshotReadinessResponse),
    /// Request the constellation to force garbage collection in all `ScriptThread`'s.
    TriggerGarbageCollection,
}

impl fmt::Debug for ScriptToConstellationMessage {
    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        let variant_string: &'static str = self.into();
        write!(formatter, "ScriptMsg::{variant_string}")
    }
}