mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-09-20 10:18:35 +03:00
cargo fmt + clippy
This commit is contained in:
parent
7f636ca06d
commit
8fb2e60cb4
@ -14,8 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use leo_span::sym;
|
||||
use super::*;
|
||||
use leo_span::sym;
|
||||
|
||||
/// An initializer for a single field / variable of a circuit initializer expression.
|
||||
/// That is, in `Foo { bar: 42, baz }`, this is either `bar: 42`, or `baz`.
|
||||
@ -55,14 +55,9 @@ pub struct CircuitExpression {
|
||||
impl CircuitExpression {
|
||||
/// Returns true if the record has all required fields and visibility.
|
||||
pub fn check_record(&self) -> bool {
|
||||
let has_member = |symbol| self
|
||||
.members
|
||||
.iter()
|
||||
.any(|variable| variable.identifier.name == symbol);
|
||||
let has_member = |symbol| self.members.iter().any(|variable| variable.identifier.name == symbol);
|
||||
|
||||
has_member(sym::owner)
|
||||
&& has_member(sym::gates)
|
||||
&& has_member(sym::_nonce)
|
||||
has_member(sym::owner) && has_member(sym::gates) && has_member(sym::_nonce)
|
||||
}
|
||||
|
||||
/// Returns the circuit as a record interface with visibility.
|
||||
@ -80,7 +75,8 @@ impl CircuitExpression {
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "))
|
||||
.join(", ")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,9 +59,7 @@ impl InputAst {
|
||||
false => definition.value.to_string(),
|
||||
true => match &definition.value {
|
||||
// Print out the record interface with visibility.
|
||||
Expression::Circuit(circuit_expression) => {
|
||||
circuit_expression.to_record_string()
|
||||
}
|
||||
Expression::Circuit(circuit_expression) => circuit_expression.to_record_string(),
|
||||
_ => panic!("Input error: Expected a circuit expression."),
|
||||
},
|
||||
},
|
||||
|
@ -264,7 +264,7 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result<Va
|
||||
let package = handler.extend_if_error(Package::<Testnet3>::open(&directory).map_err(LeoError::Anyhow))?;
|
||||
|
||||
// Get the program process and check all instructions.
|
||||
// handler.extend_if_error(package.get_process().map_err(LeoError::Anyhow))?;
|
||||
handler.extend_if_error(package.get_process().map_err(LeoError::Anyhow))?;
|
||||
}
|
||||
|
||||
let initial_ast = hash_file("/tmp/output/initial_ast.json");
|
||||
|
@ -17,8 +17,8 @@
|
||||
use super::*;
|
||||
use leo_errors::{ParserError, Result};
|
||||
|
||||
use snarkvm_console::{account::Address, network::Testnet3};
|
||||
use leo_span::Symbol;
|
||||
use snarkvm_console::{account::Address, network::Testnet3};
|
||||
|
||||
const INT_TYPES: &[Token] = &[
|
||||
Token::I8,
|
||||
|
Loading…
Reference in New Issue
Block a user