MCPcopy Create free account
hub / github.com/astral-sh/ruff / next

Method next

crates/ruff_python_ast/src/expression.rs:329–346  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

327 type Item = StringLikePart<'a>;
328
329 fn next(&mut self) -> Option<Self::Item> {
330 let part = match self {
331 StringLikePartIter::String(inner) => StringLikePart::String(inner.next()?),
332 StringLikePartIter::Bytes(inner) => StringLikePart::Bytes(inner.next()?),
333 StringLikePartIter::FString(inner) => {
334 let part = inner.next()?;
335 match part {
336 ast::FStringPart::Literal(string_literal) => {
337 StringLikePart::String(string_literal)
338 }
339 ast::FStringPart::FString(f_string) => StringLikePart::FString(f_string),
340 }
341 }
342 StringLikePartIter::TString(inner) => StringLikePart::TString(inner.next()?),
343 };
344
345 Some(part)
346 }
347
348 fn size_hint(&self) -> (usize, Option<usize>) {
349 match self {

Callers

nothing calls this directly

Calls 3

BytesClass · 0.85
TStringClass · 0.85
FStringClass · 0.70

Tested by

no test coverage detected