Skip to content

Commit

Permalink
Removed a bunch of warnings and clippy errors (#1754)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Razican committed Dec 23, 2021
1 parent baa272c commit 039c46b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions boa/src/environment/lexical_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions boa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions boa_tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -354,6 +355,7 @@ enum TestOutcomeResult {

/// Represents a test.
#[derive(Debug, Clone, Default)]
#[allow(dead_code)]
struct Test {
name: Box<str>,
description: Box<str>,
Expand Down Expand Up @@ -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 change: 1 addition & 0 deletions boa_tester/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>>,
Expand Down

0 comments on commit 039c46b

Please sign in to comment.