mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-24 13:47:38 +00:00
refactor: Fix new Clippy suggestions (#1006)
* Fix new Clippy suggestions This just cleans up a few new suggestions from Clippy. * Dummy commit to trigger CI
This commit is contained in:
parent
cae6a3dfc3
commit
f790b67e3d
@ -1,7 +1,7 @@
|
||||
use std::ffi::OsStr;
|
||||
use std::iter::Iterator;
|
||||
use std::ops::Deref;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::Path;
|
||||
use std::str;
|
||||
|
||||
use super::{Context, Module, RootModuleConfig};
|
||||
@ -31,10 +31,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
// Typically it is twice as fast as running `dotnet --version`.
|
||||
let enable_heuristic = config.heuristic;
|
||||
let version = if enable_heuristic {
|
||||
let repo_root = context
|
||||
.get_repo()
|
||||
.ok()
|
||||
.and_then(|r| r.root.as_ref().map(PathBuf::as_path));
|
||||
let repo_root = context.get_repo().ok().and_then(|r| r.root.as_deref());
|
||||
estimate_dotnet_version(&dotnet_files, &context.current_dir, repo_root)?
|
||||
} else {
|
||||
get_version_from_cli()?
|
||||
|
@ -47,7 +47,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
let kube_cfg = match env::var("KUBECONFIG") {
|
||||
Ok(paths) => env::split_paths(&paths)
|
||||
.filter_map(|filename| parse_kubectl_file(&filename))
|
||||
.nth(0),
|
||||
.next(),
|
||||
Err(_) => {
|
||||
let filename = dirs::home_dir()?.join(".kube").join("config");
|
||||
parse_kubectl_file(&filename)
|
||||
|
Loading…
Reference in New Issue
Block a user