add profiling feature
This commit is contained in:
parent
1326e8f000
commit
05b78a3ddd
@ -44,6 +44,8 @@ nightly = []
|
|||||||
random = ["rand"]
|
random = ["rand"]
|
||||||
# Option: compile to web assembly
|
# Option: compile to web assembly
|
||||||
wasm = ["wasm-bindgen"]
|
wasm = ["wasm-bindgen"]
|
||||||
|
# Option: enable features that assist in profiling (e.g. inline(never))
|
||||||
|
profiling = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
|
@ -80,6 +80,7 @@ grass input.scss
|
|||||||
clippy::redundant_pub_crate,
|
clippy::redundant_pub_crate,
|
||||||
)]
|
)]
|
||||||
#![cfg_attr(feature = "nightly", feature(track_caller))]
|
#![cfg_attr(feature = "nightly", feature(track_caller))]
|
||||||
|
#![cfg_attr(feature = "profiling", inline(never))]
|
||||||
|
|
||||||
use std::iter::Iterator;
|
use std::iter::Iterator;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ arg_enum! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "profiling", inline(never))]
|
||||||
fn main() -> std::io::Result<()> {
|
fn main() -> std::io::Result<()> {
|
||||||
let matches = App::new("grass")
|
let matches = App::new("grass")
|
||||||
.version(env!("CARGO_PKG_VERSION"))
|
.version(env!("CARGO_PKG_VERSION"))
|
||||||
|
@ -71,7 +71,8 @@ impl StyleSheet {
|
|||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[cfg_attr(feature = "profiling", inline(never))]
|
||||||
|
#[cfg_attr(not(feature = "profiling"), inline)]
|
||||||
#[cfg(not(feature = "wasm"))]
|
#[cfg(not(feature = "wasm"))]
|
||||||
pub fn new(input: String) -> SassResult<String> {
|
pub fn new(input: String) -> SassResult<String> {
|
||||||
let mut map = CodeMap::new();
|
let mut map = CodeMap::new();
|
||||||
@ -102,7 +103,8 @@ impl StyleSheet {
|
|||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[cfg_attr(feature = "profiling", inline(never))]
|
||||||
|
#[cfg_attr(not(feature = "profiling"), inline)]
|
||||||
#[cfg(not(feature = "wasm"))]
|
#[cfg(not(feature = "wasm"))]
|
||||||
pub fn from_path(p: &str) -> SassResult<String> {
|
pub fn from_path(p: &str) -> SassResult<String> {
|
||||||
let mut map = CodeMap::new();
|
let mut map = CodeMap::new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user