Files
AstralRinth/theseus/src/util/mod.rs
Wyatt Verchere 8512b45e2b Jre detection (#54)
* initial jre detection commit

* added WinReg searching

* added windows support + refactored

* Cargo lock

* fixed linux + added canonicalization

* fixed bug in mac

* Added dunce; handling UNC paths better for canonicalization

* missed cargo lock

* removed tests, added comments

* cargo fmt

* removed redundant mac address, loop over folder

---------

Co-authored-by: Wyatt <wyatt@modrinth.com>
2023-03-28 10:31:47 -07:00

25 lines
638 B
Rust

//! Theseus utility functions
pub mod fetch;
pub mod jre;
pub mod platform;
/// Wrap a builder which uses a mut reference into one which outputs an owned value
macro_rules! wrap_ref_builder {
($id:ident = $init:expr => $transform:block) => {{
let mut it = $init;
{
let $id = &mut it;
$transform;
}
it
}};
}
/// Alias a trait, used to avoid needing nightly features
macro_rules! alias_trait {
($scope:vis $name:ident : $bound:path $(, $bounds:path)*) => {
$scope trait $name: $bound $(+ $bounds)* {}
impl<T: $bound $(+ $bounds)*> $name for T {}
}
}