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

Method index

crates/wtf8/src/lib.rs:1211–1221  ·  view source on GitHub ↗
(&self, range: ops::Range<usize>)

Source from the content-addressed store, hash-verified

1209 #[inline]
1210 #[track_caller]
1211 fn index(&self, range: ops::Range<usize>) -> &Wtf8 {
1212 // is_code_point_boundary checks that the index is in [0, .len()]
1213 if range.start <= range.end
1214 && is_code_point_boundary(self, range.start)
1215 && is_code_point_boundary(self, range.end)
1216 {
1217 unsafe { slice_unchecked(self, range.start, range.end) }
1218 } else {
1219 slice_error_fail(self, range.start, range.end)
1220 }
1221 }
1222}
1223
1224/// Returns a slice of the given string from byte `begin` to its end.

Callers

nothing calls this directly

Calls 4

is_code_point_boundaryFunction · 0.85
slice_uncheckedFunction · 0.85
slice_error_failFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected