mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
fix: fix some nightly warnings
This commit is contained in:
parent
0742081921
commit
899a52bf28
5 changed files with 16 additions and 27 deletions
|
|
@ -1727,7 +1727,7 @@ pub struct UsingDeclaration<'a> {
|
|||
#[cfg_attr(feature = "serialize", serde(flatten))]
|
||||
pub span: Span,
|
||||
pub is_await: bool,
|
||||
#[cfg_attr(feature = "serde-impl", serde(default))]
|
||||
#[cfg_attr(feature = "serialize", serde(default))]
|
||||
pub declarations: Vec<'a, VariableDeclarator<'a>>,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
mod linter;
|
||||
mod options;
|
||||
|
||||
use crate::linter::{DiagnosticReport, ServerLinter};
|
||||
use globset::Glob;
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct LintOptions {
|
||||
pub paths: Vec<PathBuf>,
|
||||
pub fix: bool,
|
||||
pub ignore_path: PathBuf,
|
||||
pub no_ignore: bool,
|
||||
pub ignore_pattern: Vec<String>,
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ use crate::error::{Error, Result};
|
|||
/// - Quote `source_content` at parallel.
|
||||
/// - If you using `ConcatSourceMapBuilder`, serialize `tokens` to vlq `mappings` at parallel.
|
||||
use crate::{token::TokenChunk, SourceMap, Token};
|
||||
#[cfg(feature = "rayon")]
|
||||
#[cfg(feature = "concurrent")]
|
||||
use rayon::prelude::*;
|
||||
|
||||
// Here using `serde_json::to_string` to serialization `names/source_contents/sources`.
|
||||
|
|
@ -42,7 +42,7 @@ pub fn encode(sourcemap: &SourceMap) -> Result<String> {
|
|||
if let Some(source_contents) = &sourcemap.source_contents {
|
||||
buf.push_str("],\"sourcesContent\":[");
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "rayon")] {
|
||||
if #[cfg(feature = "concurrent")] {
|
||||
let quote_source_contents = source_contents
|
||||
.par_iter()
|
||||
.map(|x| serde_json::to_string(x.as_ref()))
|
||||
|
|
@ -82,7 +82,7 @@ fn serialize_sourcemap_mappings(sm: &SourceMap) -> String {
|
|||
|token_chunks| {
|
||||
// Serialize `tokens` to vlq `mappings` at parallel.
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "rayon")] {
|
||||
if #[cfg(feature = "concurrent")] {
|
||||
token_chunks
|
||||
.par_iter()
|
||||
.map(|token_chunk| serialize_mappings(&sm.tokens, token_chunk))
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@ use saphyr::{Yaml, YamlLoader};
|
|||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct MetaData {
|
||||
pub description: Box<str>,
|
||||
pub esid: Option<Box<str>>,
|
||||
pub es5id: Option<Box<str>>,
|
||||
pub es6id: Option<Box<str>>,
|
||||
pub info: Box<str>,
|
||||
// pub description: Box<str>,
|
||||
// pub esid: Option<Box<str>>,
|
||||
// pub es5id: Option<Box<str>>,
|
||||
// pub es6id: Option<Box<str>>,
|
||||
// pub info: Box<str>,
|
||||
pub features: Box<[Box<str>]>,
|
||||
pub includes: Box<[Box<str>]>,
|
||||
pub flags: Box<[TestFlag]>,
|
||||
pub negative: Option<Negative>,
|
||||
pub locale: Box<[Box<str>]>,
|
||||
// pub locale: Box<[Box<str>]>,
|
||||
}
|
||||
|
||||
/// Individual test flag.
|
||||
|
|
@ -90,11 +90,11 @@ impl MetaData {
|
|||
let yamls = YamlLoader::load_from_str(s).unwrap_or_default();
|
||||
let Some(yaml) = yamls.first() else { return Self::default() };
|
||||
Self {
|
||||
description: yaml["description"].as_str().unwrap_or_default().into(),
|
||||
esid: yaml["esid"].as_str().map(Into::into),
|
||||
es5id: yaml["es5id"].as_str().map(Into::into),
|
||||
es6id: yaml["es6id"].as_str().map(Into::into),
|
||||
info: yaml["info"].as_str().unwrap_or_default().into(),
|
||||
// description: yaml["description"].as_str().unwrap_or_default().into(),
|
||||
// esid: yaml["esid"].as_str().map(Into::into),
|
||||
// es5id: yaml["es5id"].as_str().map(Into::into),
|
||||
// es6id: yaml["es6id"].as_str().map(Into::into),
|
||||
// info: yaml["info"].as_str().unwrap_or_default().into(),
|
||||
features: Self::get_vec_of_string(&yaml["features"]),
|
||||
includes: Self::get_vec_of_string(&yaml["includes"]),
|
||||
flags: yaml["flags"]
|
||||
|
|
@ -109,7 +109,7 @@ impl MetaData {
|
|||
let yaml = &yaml["negative"];
|
||||
(!yaml.is_null() && !yaml.is_badvalue()).then(|| Negative::from_yaml(yaml))
|
||||
},
|
||||
locale: Self::get_vec_of_string(&yaml["locale"]),
|
||||
// locale: Self::get_vec_of_string(&yaml["locale"]),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue