Skip to main content

solar_core/
lib.rs

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