Skip to main content

solar_core/
lib.rs

1mod config;
2mod global;
3mod solar_error;
4mod subcommand;
5pub mod tool;
6mod unit_command;
7
8pub use config::Config;
9pub use global::{Global, SOLARCONFIGNAME};
10pub use solar_error::SolarError;
11pub use subcommand::{
12    Subcommand,
13    init::{Init, solar_init},
14    install::Install,
15    new::{New, solar_new},
16    update::{Update, solar_update},
17    upgrade::Upgrade,
18};
19pub use tool::{
20    Action, CargoDeny, Commitalyzer, GithubWorkflows, LICENSES_DIR, Licenses, PreCommit,
21    SemverRelease, Tool, ToolTrait, Vhooks,
22};
23pub use unit_command::{SolarCommand, UnitCommand};
24
25/// Method that provides a sorted collection. Takes ownership of the collection, mutates it in place,
26/// then returns it as an owned value. Useful if you just want a one-liner to get a sorted collection rather
27/// than a separate line to sort the collection after its instantiated, especially if you don't want the
28/// collection to be mutable after sorting.
29pub fn sorted<C, U>(mut collection: C) -> C
30where
31    C: AsMut<[U]>,
32    U: Ord,
33{
34    collection.as_mut().sort();
35    collection
36}