Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove celVarToDecl method #371

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions common/src/main/java/dev/cel/common/CelVarDecl.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@

package dev.cel.common;

import dev.cel.expr.Decl;
import dev.cel.expr.Decl.IdentDecl;
import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting;
import com.google.errorprone.annotations.CheckReturnValue;
import dev.cel.common.types.CelType;
import dev.cel.common.types.CelTypes;

/** Abstract representation of a CEL variable declaration. */
@AutoValue
Expand All @@ -37,13 +33,4 @@ public abstract class CelVarDecl {
public static CelVarDecl newVarDeclaration(String name, CelType type) {
return new AutoValue_CelVarDecl(name, type);
}

/** Converts a {@link CelVarDecl} to a protobuf equivalent form {@code Decl} */
@VisibleForTesting
public static Decl celVarToDecl(CelVarDecl varDecl) {
return Decl.newBuilder()
.setName(varDecl.name())
.setIdent(IdentDecl.newBuilder().setType(CelTypes.celTypeToType(varDecl.type())))
.build();
}
}
Loading