mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 21:41:37 +00:00
Revert the utf8 path change
This commit is contained in:
parent
d9ae0aa6b5
commit
ef35e70446
1 changed files with 6 additions and 5 deletions
|
|
@ -7,12 +7,13 @@ use serde::{ser::SerializeSeq, Serialize, Serializer};
|
|||
|
||||
/// Converts the provided value into a String with all directory separators
|
||||
/// converted into `/`.
|
||||
///
|
||||
/// Paths that contain invalid Unicode are converted lossily (invalid sequences
|
||||
/// become the replacement character), since such paths cannot be represented
|
||||
/// faithfully in a UTF-8 string regardless.
|
||||
pub fn display_absolute<T: AsRef<Path>>(path: T) -> String {
|
||||
path.as_ref().to_string_lossy().replace('\\', "/")
|
||||
let as_str = path
|
||||
.as_ref()
|
||||
.as_os_str()
|
||||
.to_str()
|
||||
.expect("Invalid Unicode in file path, cannot serialize");
|
||||
as_str.replace('\\', "/")
|
||||
}
|
||||
|
||||
/// A serializer for serde that serialize a value with all directory separators
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue