Skip to main content

trim_javascript_end

Function trim_javascript_end 

Source
pub fn trim_javascript_end(text: &str) -> &str
Expand description

What: Remove trailing JavaScript whitespace, as String.prototype.trimEnd. &str borrows text; the result borrows a slice of it. Why: Git’s PID file text is trimmed at the end only before its pid prefix is read.

In TS you’d write (pseudocode):

function trimJavascriptEnd(text: string): string { return text.trimEnd(); }