Skip to content

Commit

Permalink
miniscript: remove unused Result from extdata type_check
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Nov 27, 2024
1 parent 677cbb1 commit 515974a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/miniscript/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ mod private {
pub fn from_ast(t: Terminal<Pk, Ctx>) -> Result<Miniscript<Pk, Ctx>, Error> {
let res = Miniscript {
ty: Type::type_check(&t)?,
ext: ExtData::type_check(&t)?,
ext: ExtData::type_check(&t),
node: t,
phantom: PhantomData,
};
Expand Down
6 changes: 3 additions & 3 deletions src/miniscript/types/extra_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use core::cmp;
use core::iter::once;

use super::{Error, ScriptContext};
use super::ScriptContext;
use crate::miniscript::context::SigType;
use crate::prelude::*;
use crate::{script_num_size, AbsLockTime, MiniscriptKey, RelLockTime, Terminal};
Expand Down Expand Up @@ -924,7 +924,7 @@ impl ExtData {

/// Compute the type of a fragment assuming all the children of
/// Miniscript have been computed already.
pub fn type_check<Pk, Ctx>(fragment: &Terminal<Pk, Ctx>) -> Result<Self, Error>
pub fn type_check<Pk, Ctx>(fragment: &Terminal<Pk, Ctx>) -> Self
where
Ctx: ScriptContext,
Pk: MiniscriptKey,
Expand Down Expand Up @@ -990,7 +990,7 @@ impl ExtData {
}
};
ret.sanity_checks();
Ok(ret)
ret
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/policy/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> AstElemExt<Pk, Ctx> {
//Types and ExtData are already cached and stored in children. So, we can
//type_check without cache. For Compiler extra data, we supply a cache.
let ty = types::Type::type_check(&ast)?;
let ext = types::ExtData::type_check(&ast)?;
let ext = types::ExtData::type_check(&ast);
let comp_ext_data = CompilerExtData::type_check_with_child(&ast, lookup_ext);
Ok(AstElemExt {
ms: Arc::new(Miniscript::from_components_unchecked(ast, ty, ext)),
Expand All @@ -563,7 +563,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> AstElemExt<Pk, Ctx> {
//Types and ExtData are already cached and stored in children. So, we can
//type_check without cache. For Compiler extra data, we supply a cache.
let ty = types::Type::type_check(&ast)?;
let ext = types::ExtData::type_check(&ast)?;
let ext = types::ExtData::type_check(&ast);
let comp_ext_data = CompilerExtData::type_check_with_child(&ast, lookup_ext);
Ok(AstElemExt {
ms: Arc::new(Miniscript::from_components_unchecked(ast, ty, ext)),
Expand Down

0 comments on commit 515974a

Please sign in to comment.