rustfmt
This commit is contained in:
parent
31bbe8f60f
commit
10059daad9
12
src/lib.rs
12
src/lib.rs
@ -107,7 +107,11 @@ fn raw_to_parse_error(map: &CodeMap, err: Error, unicode: bool) -> Box<Error> {
|
|||||||
Box::new(Error::from_loc(message, map.look_up_span(span), unicode))
|
Box::new(Error::from_loc(message, map.look_up_span(span), unicode))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_string_with_file_name<P: AsRef<Path>>(input: String, file_name: P, options: &Options) -> Result<String> {
|
fn from_string_with_file_name<P: AsRef<Path>>(
|
||||||
|
input: String,
|
||||||
|
file_name: P,
|
||||||
|
options: &Options,
|
||||||
|
) -> Result<String> {
|
||||||
let mut map = CodeMap::new();
|
let mut map = CodeMap::new();
|
||||||
let path = file_name.as_ref();
|
let path = file_name.as_ref();
|
||||||
let file = map.add_file(path.to_string_lossy().into_owned(), input);
|
let file = map.add_file(path.to_string_lossy().into_owned(), input);
|
||||||
@ -178,11 +182,7 @@ fn from_string_with_file_name<P: AsRef<Path>>(input: String, file_name: P, optio
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_path<P: AsRef<Path>>(p: P, options: &Options) -> Result<String> {
|
pub fn from_path<P: AsRef<Path>>(p: P, options: &Options) -> Result<String> {
|
||||||
from_string_with_file_name(
|
from_string_with_file_name(String::from_utf8(options.fs.read(p.as_ref())?)?, p, options)
|
||||||
String::from_utf8(options.fs.read(p.as_ref())?)?,
|
|
||||||
p,
|
|
||||||
options,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compile CSS from a string
|
/// Compile CSS from a string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user