🧑💻 Passes fmt and clippy checks
This commit is contained in:
parent
7367d37ec1
commit
12cd3df661
3 changed files with 10 additions and 4 deletions
|
|
@ -20,6 +20,12 @@ use std::io::Error;
|
|||
|
||||
pub struct Application;
|
||||
|
||||
impl Default for Application {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Application {
|
||||
/// Creates a new application instance without any package.
|
||||
pub fn new() -> Self {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ where
|
|||
let (uri, contents) = match self
|
||||
.source
|
||||
.resolve()
|
||||
.map_err(|err| ConfigError::Foreign(err))
|
||||
.map_err(ConfigError::Foreign)
|
||||
{
|
||||
Ok((uri, contents)) => (uri, contents),
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ impl FileSourceFile {
|
|||
// First check for an _exact_ match.
|
||||
let mut filename = env::current_dir()?.as_path().join(self.name.clone());
|
||||
if filename.is_file() {
|
||||
if vec!["toml"].contains(
|
||||
if ["toml"].contains(
|
||||
&filename
|
||||
.extension()
|
||||
.unwrap_or_default()
|
||||
|
|
@ -108,8 +108,8 @@ fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
|
|||
}
|
||||
(None, _) => comps.push(Component::ParentDir),
|
||||
(Some(a), Some(b)) if comps.is_empty() && a == b => (),
|
||||
(Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
|
||||
(Some(_), Some(b)) if b == Component::ParentDir => return None,
|
||||
(Some(a), Some(Component::CurDir)) => comps.push(a),
|
||||
(Some(_), Some(Component::ParentDir)) => return None,
|
||||
(Some(a), Some(_)) => {
|
||||
comps.push(Component::ParentDir);
|
||||
for _ in itb {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue