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

Function horizontal_rule

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

Source from the content-addressed store, hash-verified

264}
265
266fn horizontal_rule<'a, 'b>(
267 mut o: impl Write + 'b,
268 state: &'b mut ParseState,
269) -> impl FnMut(&mut Partial<&'a str>) -> PResult<(), Error<'a>> + 'b {
270 move |i| {
271 if !state.newline {
272 return Err(ErrMode::from_error_kind(i, ErrorKind::Fail));
273 }
274
275 (
276 space0,
277 alt((take_while(3.., '-'), take_while(3.., '*'), take_while(3.., '_'))),
278 )
279 .parse_next(i)?;
280
281 state.column = 0;
282 state.set_newline = true;
283
284 let rule_width = state.terminal_width.unwrap_or(DEFAULT_RULE_WIDTH);
285 queue(&mut o, style::Print(format!("{}\n", "━".repeat(rule_width))))
286 }
287}
288
289fn code<'a, 'b>(
290 mut o: impl Write + 'b,

Callers

nothing calls this directly

Calls 1

queueFunction · 0.85

Tested by

no test coverage detected