mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 03:36:06 +00:00
rustfmt the codebase
This commit is contained in:
parent
fea303ac8b
commit
7fb9aa2115
45 changed files with 766 additions and 764 deletions
|
|
@ -33,22 +33,27 @@ use std::path::{Component, Path};
|
|||
use serde::Serializer;
|
||||
|
||||
pub fn serialize_option<S, T>(maybe_path: &Option<T>, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where S: Serializer,
|
||||
T: AsRef<Path>,
|
||||
where
|
||||
S: Serializer,
|
||||
T: AsRef<Path>,
|
||||
{
|
||||
match maybe_path {
|
||||
Some(path) => serialize(path, serializer),
|
||||
None => serializer.serialize_none()
|
||||
None => serializer.serialize_none(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn serialize<S, T>(path: T, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where S: Serializer,
|
||||
T: AsRef<Path>,
|
||||
where
|
||||
S: Serializer,
|
||||
T: AsRef<Path>,
|
||||
{
|
||||
let path = path.as_ref();
|
||||
|
||||
assert!(path.is_relative(), "path_serializer can only handle relative paths");
|
||||
assert!(
|
||||
path.is_relative(),
|
||||
"path_serializer can only handle relative paths"
|
||||
);
|
||||
|
||||
let mut output = String::new();
|
||||
|
||||
|
|
@ -66,4 +71,4 @@ pub fn serialize<S, T>(path: T, serializer: S) -> Result<S::Ok, S::Error>
|
|||
}
|
||||
|
||||
serializer.serialize_str(&output)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue