Skip to content

Commit 55a836f

Browse files
committed
rust: Transformation trait refactoring
1 parent ea3a5b3 commit 55a836f

File tree

3 files changed

+262
-33
lines changed

3 files changed

+262
-33
lines changed

rust/bear/src/modes/semantic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use crate::intercept::Envelope;
44
use crate::output::OutputWriter;
55
use crate::semantic::interpreters::create_interpreter;
6+
use crate::semantic::transformation;
67
use crate::semantic::transformation::FilterAndFormat;
78
use crate::{args, config, output, semantic};
89
use anyhow::Context;
@@ -13,7 +14,7 @@ use std::path::{Path, PathBuf};
1314
/// The semantic analysis that is independent of the event source.
1415
pub(super) struct SemanticAnalysisPipeline {
1516
interpreter: Box<dyn semantic::Interpreter>,
16-
transformation: Box<dyn semantic::Transformation>,
17+
transformation: Box<dyn transformation::Transformation>,
1718
output_writer: OutputWriterImpl,
1819
}
1920

rust/bear/src/semantic/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,6 @@ impl<T> IntoIterator for Recognition<T> {
7979
}
8080
}
8181

82-
/// Responsible to transform the semantic of an executed command.
83-
///
84-
/// It conditionally removes compiler calls based on compiler names or flags.
85-
/// It can also alter the compiler flags of the compiler calls. The actions
86-
/// are defined in the configuration this module is given.
87-
pub trait Transformation: Send {
88-
fn apply(&self, _: CompilerCall) -> anyhow::Result<CompilerCall>;
89-
}
90-
9182
/// Serialize compiler calls into a JSON array.
9283
pub fn serialize(
9384
writer: impl std::io::Write,

0 commit comments

Comments
 (0)