Skip to content

Commit

Permalink
Rename HighlightProcessor to HighlightProcessorLegacy
Browse files Browse the repository at this point in the history
  • Loading branch information
bensadeh committed Oct 12, 2024
1 parent ba160c4 commit 693e015
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use crate::types::Highlight;
use rayon::prelude::*;
use std::sync::Arc;

pub struct HighlightProcessor {
pub struct HighlightProcessorLegacy {
highlighters: Highlighters,
}

impl HighlightProcessor {
pub const fn new(highlighters: Highlighters) -> HighlightProcessor {
HighlightProcessor { highlighters }
impl HighlightProcessorLegacy {
pub const fn new(highlighters: Highlighters) -> HighlightProcessorLegacy {
HighlightProcessorLegacy { highlighters }
}

pub fn apply(&self, lines: Vec<String>) -> String {
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod cli;
mod config;
mod highlight_processor;
mod highlight_processor_legacy;
mod highlight_utils;
mod highlighter;
mod highlighters;
Expand All @@ -13,7 +13,7 @@ mod theme_legacy;
mod types;

use crate::cli::Cli;
use crate::highlight_processor::HighlightProcessor;
use crate::highlight_processor_legacy::HighlightProcessorLegacy;
use crate::io::controller::get_io_and_presenter;
use crate::io::presenter::Present;
use crate::io::reader::AsyncLineReader;
Expand Down Expand Up @@ -50,7 +50,7 @@ pub async fn run(theme: Theme, config: Config, cli: Cli) {
let (io, presenter) = get_io_and_presenter(config, Some(reached_eof_tx)).await;

let highlighter = highlighters::Highlighters::new(&theme, &cli);
let highlight_processor = HighlightProcessor::new(highlighter);
let highlight_processor = HighlightProcessorLegacy::new(highlighter);

tokio::spawn(process_lines(io, highlight_processor));

Expand All @@ -63,7 +63,7 @@ pub async fn run(theme: Theme, config: Config, cli: Cli) {

async fn process_lines<T: AsyncLineReader + AsyncLineWriter + Unpin + Send>(
mut io: T,
highlight_processor: HighlightProcessor,
highlight_processor: HighlightProcessorLegacy,
) {
while let Ok(Some(line)) = io.next_line().await {
let highlighted_lines = highlight_processor.apply(line);
Expand Down

0 comments on commit 693e015

Please sign in to comment.