mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Upgrade and pin deps so that rbx-tree can break some APIs
This commit is contained in:
parent
811db2e668
commit
3e1c467b65
4 changed files with 51 additions and 241 deletions
|
|
@ -29,6 +29,9 @@ pub enum UploadError {
|
|||
|
||||
#[fail(display = "HTTP error: {}", _0)]
|
||||
HttpError(#[fail(cause)] reqwest::Error),
|
||||
|
||||
#[fail(display = "XML model file error")]
|
||||
XmlModelEncodeError(rbx_xml::EncodeError),
|
||||
}
|
||||
|
||||
impl From<ProjectLoadFuzzyError> for UploadError {
|
||||
|
|
@ -49,6 +52,12 @@ impl From<reqwest::Error> for UploadError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<rbx_xml::EncodeError> for UploadError {
|
||||
fn from(error: rbx_xml::EncodeError) -> UploadError {
|
||||
UploadError::XmlModelEncodeError(error)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct UploadOptions<'a> {
|
||||
pub fuzzy_project_path: PathBuf,
|
||||
|
|
@ -77,10 +86,10 @@ pub fn upload(options: &UploadOptions) -> Result<(), UploadError> {
|
|||
match options.kind {
|
||||
Some("place") | None => {
|
||||
let top_level_ids = tree.get_instance(root_id).unwrap().get_children_ids();
|
||||
rbx_xml::encode(&tree, top_level_ids, &mut contents);
|
||||
rbx_xml::encode(&tree, top_level_ids, &mut contents)?;
|
||||
},
|
||||
Some("model") => {
|
||||
rbx_xml::encode(&tree, &[root_id], &mut contents);
|
||||
rbx_xml::encode(&tree, &[root_id], &mut contents)?;
|
||||
},
|
||||
Some(invalid) => return Err(UploadError::InvalidKind(invalid.to_owned())),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue