-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor: simplify json encoding using t2op #78
Conversation
7a4360d
to
03b3762
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/json/op.rs
Outdated
_ => { | ||
return Err(err()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ => { | |
return Err(err()); | |
} | |
_ => return Err(err()), |
#[derive(Debug, Error, PartialEq, Clone, Copy)] | ||
#[error("Not a T2Op.")] | ||
pub struct NotT2Op; | ||
|
||
// this trait could be implemented in Hugr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// this trait could be implemented in Hugr |
not anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made more generic so that this remains true hopefully
src/ops.rs
Outdated
ExternalOp::Extension(e) => Self::try_from_op_def(e.def()), | ||
ExternalOp::Opaque(o) => from_extension_name(o.extension(), o.name()), | ||
} | ||
.map_err(|_| "not a T2Op"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use NotT2Op
as the TryFrom error?
f555e24
to
dfe5e8c
Compare
dfe5e8c
to
3f4cecd
Compare
No description provided.