Skip to content

Commit

Permalink
Lints
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Oct 6, 2023
1 parent b339599 commit 0894238
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions crates/turbopack-css/src/lifetime_util.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use lightningcss::{rules::import::ImportRule, stylesheet::StyleSheet};

pub fn stylesheet_into_static<'i, 'o>(ss: &StyleSheet) -> StyleSheet<'i, 'o> {
pub fn stylesheet_into_static<'i, 'o>(_ss: &StyleSheet) -> StyleSheet<'i, 'o> {
todo!()
}

pub fn import_rule_to_static<'i>(i: &ImportRule) -> ImportRule<'i> {
pub fn import_rule_to_static<'i>(_i: &ImportRule) -> ImportRule<'i> {
todo!()
}
7 changes: 3 additions & 4 deletions crates/turbopack-css/src/parse.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use once_cell::sync::Lazy;
use regex::Regex;
use swc_core::common::{source_map::SourceMapGenConfig, FileName};
use turbopack_core::SOURCE_MAP_ROOT_NAME;

// Capture up until the first "."
static BASENAME_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"^[^.]*").unwrap());
// // Capture up until the first "."
// static BASENAME_RE: Lazy<Regex> = Lazy::new(||
// Regex::new(r"^[^.]*").unwrap());

/// A config to generate a source map which includes the source content of every
/// source file. SWC doesn't inline sources content by default when generating a
Expand Down
12 changes: 6 additions & 6 deletions crates/turbopack-css/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum ParseCssResult {
}

impl PartialEq for ParseCssResult {
fn eq(&self, other: &Self) -> bool {
fn eq(&self, _: &Self) -> bool {
false
}
}
Expand Down Expand Up @@ -77,7 +77,7 @@ pub enum CssWithPlaceholderResult {
}

impl PartialEq for CssWithPlaceholderResult {
fn eq(&self, other: &Self) -> bool {
fn eq(&self, _: &Self) -> bool {
false
}
}
Expand All @@ -101,7 +101,7 @@ pub enum FinalCssResult {
}

impl PartialEq for FinalCssResult {
fn eq(&self, other: &Self) -> bool {
fn eq(&self, _: &Self) -> bool {
false
}
}
Expand Down Expand Up @@ -234,7 +234,7 @@ pub async fn parse_css(

async fn process_content(
code: String,
fs_path: &FileSystemPath,
_fs_path: &FileSystemPath,
ident_str: &str,
source: Vc<Box<dyn Source>>,
origin: Vc<Box<dyn ResolveOrigin>>,
Expand Down Expand Up @@ -263,7 +263,7 @@ async fn process_content(

let stylesheet = match StyleSheet::parse(&code, config) {
Ok(stylesheet) => stylesheet,
Err(e) => {
Err(_e) => {
// TODO(kdy1): Report errors
// e.to_diagnostics(&handler).emit();
return Ok(ParseCssResult::Unparseable.into());
Expand All @@ -288,7 +288,7 @@ pub struct ParseCssResultSourceMap {
}

impl PartialEq for ParseCssResultSourceMap {
fn eq(&self, other: &Self) -> bool {
fn eq(&self, _: &Self) -> bool {
false
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-css/src/references/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct ImportAttributes {
}

impl PartialEq for ImportAttributes {
fn eq(&self, other: &Self) -> bool {
fn eq(&self, _: &Self) -> bool {
false
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-css/src/references/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl<'a> Visitor<'_> for ModuleReferencesVisitor<'a> {
self.urls.push((u.url.to_string(), vc));
}

u.visit_children(self);
u.visit_children(self)?;

Ok(())
}
Expand Down

0 comments on commit 0894238

Please sign in to comment.