mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 05:06:29 +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={}",
|
||||
|
||||
@@ -221,7 +221,7 @@ pub enum InstigatingSource {
|
||||
ProjectNode(
|
||||
#[serde(serialize_with = "path_serializer::serialize_absolute")] PathBuf,
|
||||
String,
|
||||
ProjectNode,
|
||||
Box<ProjectNode>,
|
||||
Option<String>,
|
||||
),
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ impl RojoTree {
|
||||
self.inner.root_ref()
|
||||
}
|
||||
|
||||
pub fn get_instance(&self, id: Ref) -> Option<InstanceWithMeta> {
|
||||
pub fn get_instance(&self, id: Ref) -> Option<InstanceWithMeta<'_>> {
|
||||
if let Some(instance) = self.inner.get_by_ref(id) {
|
||||
let metadata = self.metadata_map.get(&id).unwrap();
|
||||
|
||||
@@ -83,7 +83,7 @@ impl RojoTree {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_instance_mut(&mut self, id: Ref) -> Option<InstanceWithMetaMut> {
|
||||
pub fn get_instance_mut(&mut self, id: Ref) -> Option<InstanceWithMetaMut<'_>> {
|
||||
if let Some(instance) = self.inner.get_by_ref_mut(id) {
|
||||
let metadata = self.metadata_map.get_mut(&id).unwrap();
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ pub fn snapshot_project_node(
|
||||
metadata.instigating_source = Some(InstigatingSource::ProjectNode(
|
||||
project_path.to_path_buf(),
|
||||
instance_name.to_string(),
|
||||
node.clone(),
|
||||
Box::new(node.clone()),
|
||||
parent_class.map(|name| name.to_owned()),
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user