Debian Codegraph @

src/handlers/commit_meta.rs

raw symbols SCIP
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#;
2
3 use superrust-analyzer cargo git-delta 0.19.2 handlers/::drawrust-analyzer cargo git-delta 0.19.2 handlers/draw/;
4 use craterust-analyzer cargo git-delta 0.19.2 crate/::deltarust-analyzer cargo git-delta 0.19.2 delta/::{Staterust-analyzer cargo git-delta 0.19.2 delta/State#, StateMachinerust-analyzer cargo git-delta 0.19.2 delta/StateMachine#};
5 use craterust-analyzer cargo git-delta 0.19.2 crate/::featuresrust-analyzer cargo git-delta 0.19.2 features/;
6
7 impl StateMachinerust-analyzer cargo git-delta 0.19.2 delta/StateMachine#<'_> {
8 #[inline]
9 fn test_commit_meta_header_linerust-analyzer cargo git-delta 0.19.2 handlers/commit_meta/impl#[`StateMachine<'_>`]test_commit_meta_header_line().(&self) -> bool {
10 self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config..commit_regexrust-analyzer cargo git-delta 0.19.2 config/Config#commit_regex..is_matchrust-analyzer cargo regex 1.12.3 regex/string/impl#[Regex]is_match().(&self.linerust-analyzer cargo git-delta 0.19.2 delta/StateMachine#line.)
11 }
12
13 pub fn handle_commit_meta_header_linerust-analyzer cargo git-delta 0.19.2 handlers/commit_meta/impl#[`StateMachine<'_>`]handle_commit_meta_header_line().(&mut self) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<bool> {
14 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.test_commit_meta_header_linerust-analyzer cargo git-delta 0.19.2 handlers/commit_meta/impl#[`StateMachine<'_>`]test_commit_meta_header_line().() {
15 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(false);
16 }
17 let mut handled_line = false;
18 self.painterrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#painter..paint_buffered_minus_and_plus_linesrust-analyzer cargo git-delta 0.19.2 paint/impl#[`Painter<'p>`]paint_buffered_minus_and_plus_lines().();
19 self.handle_pending_line_with_diff_namerust-analyzer cargo git-delta 0.19.2 handlers/diff_header/impl#[`StateMachine<'_>`]handle_pending_line_with_diff_name().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
20 self.staterust-analyzer cargo git-delta 0.19.2 delta/StateMachine#state. = Staterust-analyzer cargo git-delta 0.19.2 delta/State#::CommitMetarust-analyzer cargo git-delta 0.19.2 delta/State#CommitMeta#;
21 if self.should_handlerust-analyzer cargo git-delta 0.19.2 delta/impl#[`StateMachine<'a>`]should_handle().() {
22 self.painterrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#painter..emitrust-analyzer cargo git-delta 0.19.2 paint/impl#[`Painter<'p>`]emit().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
23 self._handle_commit_meta_header_linerust-analyzer cargo git-delta 0.19.2 handlers/commit_meta/impl#[`StateMachine<'_>`]_handle_commit_meta_header_line().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
24 handled_line = true
25 }
26 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(handled_line)
27 }
28
29 fn _handle_commit_meta_header_linerust-analyzer cargo git-delta 0.19.2 handlers/commit_meta/impl#[`StateMachine<'_>`]_handle_commit_meta_header_line().(&mut self) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> {
30 if self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config..commit_stylerust-analyzer cargo git-delta 0.19.2 config/Config#commit_style..is_omittedrust-analyzer cargo git-delta 0.19.2 style/Style#is_omitted. {
31 return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(());
32 }
33 let (mut draw_fn, pad, decoration_ansi_term_style) =
34 drawrust-analyzer cargo git-delta 0.19.2 handlers/draw/::get_draw_functionrust-analyzer cargo git-delta 0.19.2 handlers/draw/get_draw_function().(self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config..commit_stylerust-analyzer cargo git-delta 0.19.2 config/Config#commit_style..decoration_stylerust-analyzer cargo git-delta 0.19.2 style/Style#decoration_style.);
35 let (formatted_line, formatted_raw_line) = if self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config..hyperlinksrust-analyzer cargo git-delta 0.19.2 config/Config#hyperlinks. {
36 (
37 featuresrust-analyzer cargo git-delta 0.19.2 features/::hyperlinksrust-analyzer cargo git-delta 0.19.2 features/hyperlinks/::format_commit_line_with_osc8_commit_hyperlinkrust-analyzer cargo git-delta 0.19.2 features/hyperlinks/format_commit_line_with_osc8_commit_hyperlink().(
38 &self.linerust-analyzer cargo git-delta 0.19.2 delta/StateMachine#line.,
39 self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config.,
40 ),
41 featuresrust-analyzer cargo git-delta 0.19.2 features/::hyperlinksrust-analyzer cargo git-delta 0.19.2 features/hyperlinks/::format_commit_line_with_osc8_commit_hyperlinkrust-analyzer cargo git-delta 0.19.2 features/hyperlinks/format_commit_line_with_osc8_commit_hyperlink().(
42 &self.raw_linerust-analyzer cargo git-delta 0.19.2 delta/StateMachine#raw_line.,
43 self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config.,
44 ),
45 )
46 } else {
47 (Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[`Cow<'a, str>`][`From<&'a String>`]from().(&self.linerust-analyzer cargo git-delta 0.19.2 delta/StateMachine#line.), Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[`Cow<'a, str>`][`From<&'a String>`]from().(&self.raw_linerust-analyzer cargo git-delta 0.19.2 delta/StateMachine#raw_line.))
48 };
49
50 draw_fn(
51 self.painterrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#painter..writerrust-analyzer cargo git-delta 0.19.2 paint/Painter#writer.,
52 &formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}{}", formatted_line, if pad { " " } else { "" }),
53 &formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}{}", formatted_raw_line, if pad { " " } else { "" }),
54 "",
55 &self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config..decorations_widthrust-analyzer cargo git-delta 0.19.2 config/Config#decorations_width.,
56 self.configrust-analyzer cargo git-delta 0.19.2 delta/StateMachine#config..commit_stylerust-analyzer cargo git-delta 0.19.2 config/Config#commit_style.,
57 decoration_ansi_term_style,
58 )?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
59 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
60 }
61 }