clippy
This commit is contained in:
parent
f5a654fe5b
commit
a7c2ca7b82
10
README.md
10
README.md
@ -25,6 +25,10 @@ All known missing features and bugs are tracked in [#19](https://github.com/conn
|
|||||||
|
|
||||||
`grass` is not a drop-in replacement for `libsass` and does not intend to be. If you are upgrading to `grass` from `libsass`, you may have to make modifications to your stylesheets, though these changes should not differ from those you would have to make if upgrading to `dart-sass`.
|
`grass` is not a drop-in replacement for `libsass` and does not intend to be. If you are upgrading to `grass` from `libsass`, you may have to make modifications to your stylesheets, though these changes should not differ from those you would have to make if upgrading to `dart-sass`.
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
`grass` is benchmarked against `dart-sass` and `sassc` (`libsass`) [here](https://github.com/connorskees/sass-perf). In general, `grass` appears to be ~2x faster than `dart-sass` and ~1.7x faster than `sassc`.
|
||||||
|
|
||||||
## Web Assembly
|
## Web Assembly
|
||||||
|
|
||||||
`grass` experimentally releases a
|
`grass` experimentally releases a
|
||||||
@ -80,9 +84,9 @@ The spec runner does not work on Windows.
|
|||||||
Using a modified version of the spec runner that ignores warnings and error spans (but does include error messages), `grass` achieves the following results:
|
Using a modified version of the spec runner that ignores warnings and error spans (but does include error messages), `grass` achieves the following results:
|
||||||
|
|
||||||
```
|
```
|
||||||
2022-01-07
|
2022-01-16
|
||||||
PASSING: 6152
|
PASSING: 6153
|
||||||
FAILING: 753
|
FAILING: 752
|
||||||
TOTAL: 6905
|
TOTAL: 6905
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ pub(crate) fn hwb(mut args: ArgumentResult, visitor: &mut Visitor) -> SassResult
|
|||||||
args.span(),
|
args.span(),
|
||||||
)? {
|
)? {
|
||||||
ParsedChannels::String(s) => Err((
|
ParsedChannels::String(s) => Err((
|
||||||
format!("Expected numeric channels, got \"{}\"", s),
|
format!("Expected numeric channels, got \"{}\".", s),
|
||||||
args.span(),
|
args.span(),
|
||||||
)
|
)
|
||||||
.into()),
|
.into()),
|
||||||
|
@ -90,11 +90,9 @@ fn module_functions(mut args: ArgumentResult, visitor: &mut Visitor) -> SassResu
|
|||||||
);
|
);
|
||||||
|
|
||||||
Ok(Value::Map(
|
Ok(Value::Map(
|
||||||
(*(*visitor.env.modules)
|
(*(*visitor.env.modules).borrow().get(module, args.span())?)
|
||||||
.borrow()
|
.borrow()
|
||||||
.get(module.into(), args.span())?)
|
.functions(args.span()),
|
||||||
.borrow()
|
|
||||||
.functions(args.span()),
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,11 +106,9 @@ fn module_variables(mut args: ArgumentResult, visitor: &mut Visitor) -> SassResu
|
|||||||
);
|
);
|
||||||
|
|
||||||
Ok(Value::Map(
|
Ok(Value::Map(
|
||||||
(*(*visitor.env.modules)
|
(*(*visitor.env.modules).borrow().get(module, args.span())?)
|
||||||
.borrow()
|
.borrow()
|
||||||
.get(module.into(), args.span())?)
|
.variables(args.span()),
|
||||||
.borrow()
|
|
||||||
.variables(args.span()),
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1161,7 +1161,7 @@ impl<'a> Visitor<'a> {
|
|||||||
allows_placeholder: bool,
|
allows_placeholder: bool,
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> SassResult<SelectorList> {
|
) -> SassResult<SelectorList> {
|
||||||
let sel_toks = Lexer::new_from_string(&selector_text, span);
|
let sel_toks = Lexer::new_from_string(selector_text, span);
|
||||||
|
|
||||||
SelectorParser::new(sel_toks, allows_parent, allows_placeholder, span).parse()
|
SelectorParser::new(sel_toks, allows_parent, allows_placeholder, span).parse()
|
||||||
}
|
}
|
||||||
|
@ -1534,7 +1534,7 @@ pub(crate) trait StylesheetParser<'a>: BaseParser<'a> + Sized {
|
|||||||
&base_name[start..end]
|
&base_name[start..end]
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut toks = Lexer::new_from_string(&namespace, url_span);
|
let mut toks = Lexer::new_from_string(namespace, url_span);
|
||||||
|
|
||||||
// if namespace is empty, avoid attempting to parse an identifier from
|
// if namespace is empty, avoid attempting to parse an identifier from
|
||||||
// an empty string, as there will be no span to emit
|
// an empty string, as there will be no span to emit
|
||||||
|
@ -42,9 +42,3 @@ nightly = ["include_sass/nightly"]
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3.3.0"
|
tempfile = "3.3.0"
|
||||||
paste = "1.0.3"
|
paste = "1.0.3"
|
||||||
|
|
||||||
# [profile.release]
|
|
||||||
# debug = true
|
|
||||||
# panic = "abort"
|
|
||||||
# lto = true
|
|
||||||
# codegen-units = 1
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user