diff --git a/compiler/passes/src/type_checking/checker.rs b/compiler/passes/src/type_checking/checker.rs index e21180cda4..e567f06ed8 100644 --- a/compiler/passes/src/type_checking/checker.rs +++ b/compiler/passes/src/type_checking/checker.rs @@ -1179,7 +1179,7 @@ impl<'a, N: Network> TypeChecker<'a, N> { } // Type check the function's parameters. - function.input.iter().enumerate().for_each(|(_index, input_var)| { + function.input.iter().for_each(|input_var| { // Check that the type of input parameter is defined. self.assert_type_is_valid(input_var.type_(), input_var.span()); // Check that the type of the input parameter is not a tuple. diff --git a/compiler/span/src/span.rs b/compiler/span/src/span.rs index 1c0cedb168..f3780b1d4d 100644 --- a/compiler/span/src/span.rs +++ b/compiler/span/src/span.rs @@ -18,7 +18,7 @@ use core::ops::{Add, Sub}; use serde::{Deserialize, Serialize}; -use std::{fmt, usize}; +use std::fmt; use crate::symbol::with_session_globals; diff --git a/docs/grammar/src/main.rs b/docs/grammar/src/main.rs index 5d13b45ec2..220ba10a0b 100644 --- a/docs/grammar/src/main.rs +++ b/docs/grammar/src/main.rs @@ -113,7 +113,7 @@ impl<'a> Processor<'a> { let def = def.trim(); // try to find rule matching definition or fail - let rule = self.rules.get(&def.to_string()).cloned().unwrap(); + let rule = self.rules.get(def).cloned().unwrap(); self.enter_scope(Scope::Definition(rule)); } diff --git a/leo/cli/helpers/logger.rs b/leo/cli/helpers/logger.rs index 0edafed086..a5ee6f6c13 100644 --- a/leo/cli/helpers/logger.rs +++ b/leo/cli/helpers/logger.rs @@ -40,35 +40,6 @@ pub struct Format { } impl Format { - /// Use the full JSON format. - /// - /// The full format includes fields from all entered spans. - /// - /// # Example Output - /// - /// ```ignore,json - /// {"timestamp":"Feb 20 11:28:15.096","level":"INFO","target":"mycrate","fields":{"message":"some message", "key": "value"}} - /// ``` - /// - /// # Options - /// - /// - [`Format::flatten_event`] can be used to enable flattening event fields into the root - /// object. - /// - /// [`Format::flatten_event`]: #method.flatten_event - #[cfg(feature = "json")] - pub fn json(self) -> Format { - Format { - format: Json::default(), - timer: self.timer, - ansi: self.ansi, - display_target: self.display_target, - display_level: self.display_level, - display_thread_id: self.display_thread_id, - display_thread_name: self.display_thread_name, - } - } - /// Use the given [`timer`] for log message timestamps. /// /// See [`time`] for the provided timer implementations. diff --git a/leo/package/src/root/env.rs b/leo/package/src/root/env.rs index 483f05c1c8..44c8d47131 100644 --- a/leo/package/src/root/env.rs +++ b/leo/package/src/root/env.rs @@ -22,7 +22,7 @@ use snarkvm::console::account::PrivateKey; use snarkvm::prelude::{MainnetV0, Network, TestnetV0}; use serde::Deserialize; -use std::{borrow::Cow, fs::File, io::Write, path::Path}; +use std::{borrow::Cow, fmt, fs::File, io::Write, path::Path}; pub static ENV_FILENAME: &str = ".env"; @@ -67,15 +67,15 @@ impl Env { } } -impl ToString for Env { - fn to_string(&self) -> String { +impl fmt::Display for Env { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Get the network name. let network = match N::ID { MainnetV0::ID => NetworkName::MainnetV0, TestnetV0::ID => NetworkName::TestnetV0, _ => unimplemented!("Unsupported network"), }; - // Return the formatted string. - format!("NETWORK={network}\nPRIVATE_KEY={}\nENDPOINT={}\n", self.private_key, self.endpoint) + // Write the formatted string. + write!(f, "NETWORK={network}\nPRIVATE_KEY={}\nENDPOINT={}\n", self.private_key, self.endpoint) } } diff --git a/tests/test-framework/src/fetch.rs b/tests/test-framework/src/fetch.rs index 0df7c27076..71316ace54 100644 --- a/tests/test-framework/src/fetch.rs +++ b/tests/test-framework/src/fetch.rs @@ -28,10 +28,7 @@ pub fn find_tests(path: &Path) -> impl Iterator { // Check if the file is a .leo file. let is_leo_file = path.extension().filter(|s| *s == "leo").is_some(); // Read the test filter from the environment. - let filter = match std::env::var("TEST_FILTER") { - Ok(filter) => filter, - Err(_) => String::new(), - }; + let filter = std::env::var("TEST_FILTER").unwrap_or_default(); // Check if the path contains the filter. let satisfies_filter = filter.is_empty() || path.to_string_lossy().contains(&filter); // If the file is a .leo file and satisfies the filter, return the path and the file contents.