1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-05 01:50:51 +00:00

chore: fix the double compiling of lib and bin (#1616)

* fix: rust modules are compiled twice

The modules being declared both in the _library_ crate and the _binary_
crate made cargo compile everything twice:

1. for the library
2. for the binary

What happened was:

1. The library "starship" was compiled.
2. The binary "starship" (and all its modules) were compiled.

* fix: stop compiling every rust module twice

restrict visibility

* Run cargo fmt

* Add bug_report module

Co-authored-by: Matan Kushner <hello@matchai.dev>
Co-authored-by: Kevin Song <chips@ksong.dev>
This commit is contained in:
jRimbault 2020-10-17 11:09:27 +02:00 committed by GitHub
parent 3287e48b65
commit 95bb901b8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 21 deletions

View File

@ -4,7 +4,7 @@ use std::io::ErrorKind;
use std::process;
use std::process::Command;
use starship::config::StarshipConfig;
use crate::config::StarshipConfig;
use std::fs::File;
use std::io::Write;
use toml::map::Map;

View File

@ -1,13 +1,16 @@
// Lib is present to allow for benchmarking
pub mod bug_report;
pub mod config;
pub mod configs;
pub mod configure;
pub mod context;
pub mod formatter;
pub mod init;
pub mod logger;
pub mod module;
pub mod modules;
mod modules;
pub mod print;
pub mod segment;
mod segment;
mod utils;
#[cfg(test)]

View File

@ -2,27 +2,11 @@ use clap::{crate_authors, crate_version};
use std::io;
use std::time::SystemTime;
mod bug_report;
mod config;
mod configs;
mod configure;
mod context;
mod formatter;
mod init;
mod logger;
mod module;
mod modules;
mod print;
mod segment;
mod utils;
#[cfg(test)]
mod test;
use crate::module::ALL_MODULES;
use clap::{App, AppSettings, Arg, Shell, SubCommand};
use rand::distributions::Alphanumeric;
use rand::Rng;
use starship::module::ALL_MODULES;
use starship::*;
fn main() {
logger::init();