Browse Source

Removed a bunch of warnings and clippy errors (#1754)

This Pull Request fixes some warnings and clips errors. It conflicts with the VM/non-VM PR, so should probably go in first, so that this branch gets properly updated and we get the list of real warnings/errors there.
pull/1755/head
Iban Eguia 3 years ago
parent
commit
039c46ba7b
  1. 1
      boa/src/environment/lexical_environment.rs
  2. 1
      boa/src/lib.rs
  3. 3
      boa_tester/src/main.rs
  4. 1
      boa_tester/src/read.rs

1
boa/src/environment/lexical_environment.rs

@ -93,6 +93,7 @@ impl Context {
.recursive_get_this_binding(self)
}
#[cfg(feature = "vm")]
pub(crate) fn get_global_this_binding(&mut self) -> JsResult<JsValue> {
let global = self.realm.global_env.clone();
global.get_this_binding(self)

1
boa/src/lib.rs

@ -99,6 +99,7 @@ pub fn parse<T: AsRef<[u8]>>(src: T, strict_mode: bool) -> StdResult<StatementLi
/// Execute the code using an existing Context
/// The str is consumed and the state of the Context is changed
#[cfg(test)]
#[cfg_attr(not(feature = "vm"), allow(clippy::let_and_return))]
pub(crate) fn forward<T: AsRef<[u8]>>(context: &mut Context, src: T) -> String {
let src_bytes: &[u8] = src.as_ref();
let result = context.eval(src_bytes).map_or_else(

3
boa_tester/src/main.rs

@ -329,6 +329,7 @@ struct SuiteResult {
/// Outcome of a test.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[allow(dead_code)]
struct TestResult {
#[serde(rename = "n")]
name: Box<str>,
@ -354,6 +355,7 @@ enum TestOutcomeResult {
/// Represents a test.
#[derive(Debug, Clone, Default)]
#[allow(dead_code)]
struct Test {
name: Box<str>,
description: Box<str>,
@ -493,6 +495,7 @@ enum Phase {
/// Locale information structure.
#[derive(Debug, Default, Clone, Deserialize)]
#[serde(transparent)]
#[allow(dead_code)]
struct Locale {
locale: Box<[Box<str>]>,
}

1
boa_tester/src/read.rs

@ -7,6 +7,7 @@ use std::{fs, io, path::Path, str::FromStr};
/// Representation of the YAML metadata in Test262 tests.
#[derive(Debug, Clone, Deserialize)]
#[allow(dead_code)]
pub(super) struct MetaData {
pub(super) description: Box<str>,
pub(super) esid: Option<Box<str>>,

Loading…
Cancel
Save