MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / numbered_item

Function numbered_item

crates/chat-cli/src/cli/chat/parse.rs:249–264  ·  view source on GitHub ↗
(
    mut o: impl Write + 'b,
    state: &'b mut ParseState,
)

Source from the content-addressed store, hash-verified

247}
248
249fn numbered_item<'a, 'b>(
250 mut o: impl Write + 'b,
251 state: &'b mut ParseState,
252) -> impl FnMut(&mut Partial<&'a str>) -> PResult<(), Error<'a>> + 'b {
253 move |i| {
254 if !state.newline {
255 return Err(ErrMode::from_error_kind(i, ErrorKind::Fail));
256 }
257
258 let (ws, digits, _, _) = (space0, digit1, ".", space1).parse_next(i)?;
259 let print = format!("{ws}{digits}. ");
260
261 queue_newline_or_advance(&mut o, state, print.width())?;
262 queue(&mut o, style::Print(print))
263 }
264}
265
266fn horizontal_rule<'a, 'b>(
267 mut o: impl Write + 'b,

Callers

nothing calls this directly

Calls 2

queue_newline_or_advanceFunction · 0.85
queueFunction · 0.85

Tested by

no test coverage detected