sdk-builder: cleanup
This commit is contained in:
parent
15f2b70449
commit
117e8878d6
|
@ -1,7 +1,7 @@
|
||||||
use std::{borrow::Cow, collections::BTreeMap, path::PathBuf};
|
use std::{borrow::Cow, path::PathBuf};
|
||||||
|
|
||||||
use clap::{Args, Parser, Subcommand};
|
use clap::{Args, Parser, Subcommand};
|
||||||
use unreal_sdk::sdk::repr::{ObjectRef, Sdk};
|
use unreal_sdk::sdk::repr::Sdk;
|
||||||
|
|
||||||
use crate::rust::Builder;
|
use crate::rust::Builder;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ pub enum Commands {
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
println!("Hello, world!");
|
log::info!("Hello, world!");
|
||||||
|
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
|
@ -113,20 +113,6 @@ fn split_at_illegal_char<'a>(input: &'a str, disallowed_tokens: &[char]) -> Spli
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn canonicalize_name<'a>(
|
|
||||||
name: &'a str,
|
|
||||||
disallowed_tokens: &[char],
|
|
||||||
disallowed_strs: &[&str],
|
|
||||||
) -> Cow<'a, str> {
|
|
||||||
let valid = split_at_illegal_char(name, disallowed_tokens).into_valid(disallowed_tokens);
|
|
||||||
if disallowed_strs.contains(&valid.as_ref()) || valid.starts_with(|c: char| !c.is_alphabetic())
|
|
||||||
{
|
|
||||||
Cow::Owned(format!("_{}", &valid))
|
|
||||||
} else {
|
|
||||||
valid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn empty_or_some(s: &str) -> Option<&str> {
|
fn empty_or_some(s: &str) -> Option<&str> {
|
||||||
if s.is_empty() {
|
if s.is_empty() {
|
||||||
None
|
None
|
||||||
|
|
Loading…
Reference in a new issue