diff --git a/src/main.rs b/src/main.rs index 2889728..2b207bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,10 @@ -#![allow(clippy::declare_interior_mutable_const, clippy::borrow_interior_mutable_const, clippy::module_inception, clippy::result_large_err, clippy::type_complexity, clippy::upper_case_acronyms)] +#![allow( + clippy::declare_interior_mutable_const, + clippy::borrow_interior_mutable_const, + clippy::module_inception, + clippy::result_large_err, + clippy::type_complexity +)] mod kvstore; mod package_db; mod prelude; @@ -40,8 +46,10 @@ fn main() -> Result<()> { let build_store = KVDirStore::new(build_tmp.path())?; let db = package_db::PackageDB::new( - &[Url::parse("https://pybi.vorpus.org")?, - Url::parse("https://pypi.org/simple/")?], + &[ + Url::parse("https://pybi.vorpus.org")?, + Url::parse("https://pypi.org/simple/")?, + ], PROJECT_DIRS.cache_dir(), // PackageDB needs a place to install packages, in case it has to build some // sdists. Using a shared env_forest is efficient, because it means different diff --git a/src/trampolines/mod.rs b/src/trampolines/mod.rs index f9f4f6e..3ec5a95 100644 --- a/src/trampolines/mod.rs +++ b/src/trampolines/mod.rs @@ -2,7 +2,7 @@ use crate::{prelude::*, tree::WriteTree}; #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum ScriptType { - GUI, + Gui, Console, } #[derive(Debug, Clone, Copy, Eq, PartialEq)] @@ -58,7 +58,7 @@ impl TrampolineMaker { fn unix_trampoline(&self, script: &[u8], script_type: ScriptType) -> Vec { let prefix = match script_type { ScriptType::Console => UNIX_TEMPLATE.into(), - ScriptType::GUI => UNIX_TEMPLATE.replace("POSY_PYTHON", "POSY_PYTHONW"), + ScriptType::Gui => UNIX_TEMPLATE.replace("POSY_PYTHON", "POSY_PYTHONW"), }; let mut out = prefix.into_bytes(); out.extend_from_slice(script); @@ -68,7 +68,7 @@ impl TrampolineMaker { fn windows_trampoline(&self, script: &[u8], script_type: ScriptType) -> Vec { let prefix = match script_type { ScriptType::Console => WINDOWS_CONSOLE, - ScriptType::GUI => WINDOWS_GUI, + ScriptType::Gui => WINDOWS_GUI, }; let mut suffix = std::io::Cursor::new(Vec::::new()); { diff --git a/src/vocab/artifact_formats.rs b/src/vocab/artifact_formats.rs index 3af87a6..593fc31 100644 --- a/src/vocab/artifact_formats.rs +++ b/src/vocab/artifact_formats.rs @@ -421,7 +421,7 @@ impl Pybi { } fn script_for_entrypoint(entry: &Entrypoint, script_type: ScriptType) -> Vec { - let w = if script_type == ScriptType::GUI { + let w = if script_type == ScriptType::Gui { "w" } else { "" @@ -496,7 +496,7 @@ impl Wheel { }; write_scripts("console_scripts", ScriptType::Console)?; - write_scripts("gui_scripts", ScriptType::GUI)?; + write_scripts("gui_scripts", ScriptType::Gui)?; } Ok(()) } @@ -574,7 +574,7 @@ where if script_start.starts_with(b"#!python") { // it's some kind of script, but which kind? let script_type = if script_start.starts_with(b"#!pythonw") { - ScriptType::GUI + ScriptType::Gui } else { ScriptType::Console };