pub struct Focused {
pub before: LocList,
pub focus: LocList,
pub after: LocList,
}Fields§
§before: LocList§focus: LocList§after: LocListImplementations§
Source§impl Focused
impl Focused
Sourcepub fn print_debug(&self)
pub fn print_debug(&self)
Examples found in repository?
examples/explain/main.rs (line 28)
20fn main() -> CsResult<()> {
21 let args = Args::parse();
22 let loc_list = LocList::read_file(&args.path, Language::Rust)?;
23 let Some(sort_around) = args.sort_around else {
24 loc_list.print_debug(" WHOLE FILE ");
25 return Ok(());
26 };
27 let focused = loc_list.focus_around_line_number(sort_around)?;
28 focused.print_debug();
29 let blocks = focused.clone().focus.into_blocks();
30 for (i, block) in blocks.iter().enumerate() {
31 block.print_debug(&format!(" BLOCK {i} "));
32 }
33 let loc_list = focused.sort();
34 println!("------------ RESULT ------------");
35 print!("{}", loc_list);
36 Ok(())
37}Sourcepub fn sort(self) -> LocList
pub fn sort(self) -> LocList
Examples found in repository?
examples/explain/main.rs (line 33)
20fn main() -> CsResult<()> {
21 let args = Args::parse();
22 let loc_list = LocList::read_file(&args.path, Language::Rust)?;
23 let Some(sort_around) = args.sort_around else {
24 loc_list.print_debug(" WHOLE FILE ");
25 return Ok(());
26 };
27 let focused = loc_list.focus_around_line_number(sort_around)?;
28 focused.print_debug();
29 let blocks = focused.clone().focus.into_blocks();
30 for (i, block) in blocks.iter().enumerate() {
31 block.print_debug(&format!(" BLOCK {i} "));
32 }
33 let loc_list = focused.sort();
34 println!("------------ RESULT ------------");
35 print!("{}", loc_list);
36 Ok(())
37}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Focused
impl RefUnwindSafe for Focused
impl Send for Focused
impl Sync for Focused
impl Unpin for Focused
impl UnwindSafe for Focused
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more