Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Oct 27, 2024
1 parent ea782ea commit cf042eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ impl<'a> PostScriptFunction<'a> {
deref!('a, PostScriptFunction<'a> => Stream<'a>, stream);

/// PostScript operators for use in Type 4 functions.
#[derive(Debug, Clone, PartialEq)]
pub enum PostScriptOp {
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum PostScriptOp<'a> {
/// Push a real number.
Real(f32),
/// Push an integer number.
Expand Down Expand Up @@ -315,9 +315,9 @@ pub enum PostScriptOp {
Xor,

/// Conditional. Runs if boolean argument is true.
If(Vec<Self>),
If(&'a [Self]),
/// Conditional. Decides which branch to run depending on boolean argument.
IfElse(Vec<Self>, Vec<Self>),
IfElse(&'a [Self], &'a [Self]),

/// Copy the top elements. One integer argument.
Copy,
Expand All @@ -333,7 +333,7 @@ pub enum PostScriptOp {
Roll,
}

impl PostScriptOp {
impl PostScriptOp<'_> {
/// Encode a slice of operations into a byte stream.
pub fn encode(ops: &[Self]) -> Buf {
let mut buf = Buf::new();
Expand Down Expand Up @@ -441,7 +441,7 @@ mod tests {
Dup,
Real(0.0),
Ge,
IfElse(vec![Real(1.0), Add], vec![Neg]),
IfElse(&[Real(1.0), Add], &[Neg]),
Add,
];

Expand Down

0 comments on commit cf042eb

Please sign in to comment.