From 097f1b05f1d82967fe2a900ccf7ba3597c04ad77 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Mon, 10 Jun 2019 15:56:17 +0100 Subject: Add support for prompt configuration (#62) - Create `Config` struct that is added to `Context` when initialized - Read `~/.confg/starship.toml` during initialization (can be updated later to also look at `$XDG_CONFIG_HOME`) - `Context` now has a method for creating modules. This allows us to provide modules with a reference to the configuration specific to that module --- src/modules/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modules/mod.rs') diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 808e33744..cf1c64018 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -14,7 +14,7 @@ mod username; use crate::context::Context; use crate::module::Module; -pub fn handle(module: &str, context: &Context) -> Option { +pub fn handle<'a>(module: &str, context: &'a Context) -> Option> { match module { "dir" | "directory" => directory::segment(context), "char" | "character" => character::segment(context), -- cgit v1.2.3