1
0
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:
Thomas O'Donnell 2020-03-14 16:37:51 +01:00 committed by GitHub
parent cae6a3dfc3
commit f790b67e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -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()?

View File

@ -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)