pub enum AntiPattern {
FormatHeredoc {
location: Location,
format_name: String,
heredoc_delimiter: String,
},
BeginTimeHeredoc {
location: Location,
heredoc_content: String,
side_effects: Vec<String>,
},
DynamicHeredocDelimiter {
location: Location,
expression: String,
},
SourceFilterHeredoc {
location: Location,
module: String,
},
RegexCodeBlockHeredoc {
location: Location,
},
EvalStringHeredoc {
location: Location,
},
TiedHandleHeredoc {
location: Location,
handle_name: String,
},
}Expand description
A specific category of heredoc-related anti-pattern found in Perl source.
Each variant captures the Location of the offending construct plus any
context needed to produce a useful diagnostic message.
Variants§
FormatHeredoc
A heredoc declared inside a format body.
BeginTimeHeredoc
A heredoc declared inside a BEGIN { ... } block, evaluated at compile time.
DynamicHeredocDelimiter
A heredoc whose terminator is determined by a variable or expression at runtime.
SourceFilterHeredoc
A use Filter::* statement that may rewrite source before static analysis runs.
RegexCodeBlockHeredoc
A heredoc embedded inside a (?{ ... }) regex code block.
EvalStringHeredoc
A heredoc embedded inside a string argument to eval.
TiedHandleHeredoc
A heredoc written to a filehandle that has been tied to a custom class.
Trait Implementations§
Source§impl Clone for AntiPattern
impl Clone for AntiPattern
Source§fn clone(&self) -> AntiPattern
fn clone(&self) -> AntiPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AntiPattern
impl Debug for AntiPattern
Source§impl PartialEq for AntiPattern
impl PartialEq for AntiPattern
impl StructuralPartialEq for AntiPattern
Auto Trait Implementations§
impl Freeze for AntiPattern
impl RefUnwindSafe for AntiPattern
impl Send for AntiPattern
impl Sync for AntiPattern
impl Unpin for AntiPattern
impl UnsafeUnpin for AntiPattern
impl UnwindSafe for AntiPattern
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