mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 13:15:50 +00:00
Fix the various lints (#1124)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::{bail, format_err, Context};
|
||||
use anyhow::{bail, Context};
|
||||
use clap::Parser;
|
||||
use memofs::Vfs;
|
||||
use reqwest::{
|
||||
@@ -91,32 +90,6 @@ impl UploadCommand {
|
||||
}
|
||||
}
|
||||
|
||||
/// The kind of asset to upload to the website. Affects what endpoints Rojo uses
|
||||
/// and changes how the asset is built.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
enum UploadKind {
|
||||
/// Upload to a place.
|
||||
Place,
|
||||
|
||||
/// Upload to a model-like asset, like a Model, Plugin, or Package.
|
||||
Model,
|
||||
}
|
||||
|
||||
impl FromStr for UploadKind {
|
||||
type Err = anyhow::Error;
|
||||
|
||||
fn from_str(source: &str) -> Result<Self, Self::Err> {
|
||||
match source {
|
||||
"place" => Ok(UploadKind::Place),
|
||||
"model" => Ok(UploadKind::Model),
|
||||
attempted => Err(format_err!(
|
||||
"Invalid upload kind '{}'. Valid kinds are: place, model",
|
||||
attempted
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn do_upload(buffer: Vec<u8>, asset_id: u64, cookie: &str) -> anyhow::Result<()> {
|
||||
let url = format!(
|
||||
"https://data.roblox.com/Data/Upload.ashx?assetid={}",
|
||||
|
||||
Reference in New Issue
Block a user