Clippy
Some checks failed
CI / Check links (push) Successful in 8s
CI / Check typos (push) Successful in 9s
CI / Check version (push) Failing after 5s
CI / Clippy (push) Has been cancelled
CI / Build, test, upload (push) Has been cancelled
CI / Build and push Docker image (push) Has been cancelled
Some checks failed
CI / Check links (push) Successful in 8s
CI / Check typos (push) Successful in 9s
CI / Check version (push) Failing after 5s
CI / Clippy (push) Has been cancelled
CI / Build, test, upload (push) Has been cancelled
CI / Build and push Docker image (push) Has been cancelled
This commit is contained in:
@@ -86,15 +86,7 @@ use syn::{LitStr, parse_macro_input};
|
||||
#[proc_macro]
|
||||
pub fn sass(input: TokenStream) -> TokenStream {
|
||||
let input_lit = parse_macro_input!(input as LitStr);
|
||||
|
||||
let file_path = match PathBuf::try_from(input_lit.value()) {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
return syn::Error::new(input_lit.span(), format!("Invalid path: {e}"))
|
||||
.to_compile_error()
|
||||
.into();
|
||||
}
|
||||
};
|
||||
let file_path = PathBuf::from(input_lit.value());
|
||||
|
||||
// Not stable yet, we have to use crate-relative paths :(
|
||||
//let span = proc_macro::Span::call_site();
|
||||
@@ -108,7 +100,7 @@ pub fn sass(input: TokenStream) -> TokenStream {
|
||||
|
||||
// First, try to read and compile the file at macro expansion time
|
||||
// The path is interpreted relative to CARGO_MANIFEST_DIR
|
||||
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string());
|
||||
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_owned());
|
||||
let full_path = std::path::Path::new(&manifest_dir).join(&file_path);
|
||||
|
||||
let css = match grass::from_path(&full_path, &grass::Options::default()) {
|
||||
|
||||
Reference in New Issue
Block a user