MCPcopy Index your code
hub / github.com/RustPython/RustPython / trim_spaces

Method trim_spaces

crates/stdlib/src/csv.rs:965–973  ·  view source on GitHub ↗
(input: &[u8])

Source from the content-addressed store, hash-verified

963 let field_limit = GLOBAL_FIELD_LIMIT.lock().to_owned();
964 #[inline]
965 fn trim_spaces(input: &[u8]) -> &[u8] {
966 let trimmed_start = input.iter().position(|&x| x != b' ').unwrap_or(input.len());
967 let trimmed_end = input
968 .iter()
969 .rposition(|&x| x != b' ')
970 .map(|i| i + 1)
971 .unwrap_or(0);
972 &input[trimmed_start..trimmed_end]
973 }
974 let input = if *skipinitialspace {
975 let t = input.split(|x| x == delimiter);
976 t.map(|x| {

Callers

nothing calls this directly

Calls 4

positionMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected