🧑💻 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;
|
pub struct Application;
|
||||||
|
|
||||||
|
impl Default for Application {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Application {
|
impl Application {
|
||||||
/// Creates a new application instance without any package.
|
/// Creates a new application instance without any package.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ where
|
||||||
let (uri, contents) = match self
|
let (uri, contents) = match self
|
||||||
.source
|
.source
|
||||||
.resolve()
|
.resolve()
|
||||||
.map_err(|err| ConfigError::Foreign(err))
|
.map_err(ConfigError::Foreign)
|
||||||
{
|
{
|
||||||
Ok((uri, contents)) => (uri, contents),
|
Ok((uri, contents)) => (uri, contents),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ impl FileSourceFile {
|
||||||
// First check for an _exact_ match.
|
// First check for an _exact_ match.
|
||||||
let mut filename = env::current_dir()?.as_path().join(self.name.clone());
|
let mut filename = env::current_dir()?.as_path().join(self.name.clone());
|
||||||
if filename.is_file() {
|
if filename.is_file() {
|
||||||
if vec!["toml"].contains(
|
if ["toml"].contains(
|
||||||
&filename
|
&filename
|
||||||
.extension()
|
.extension()
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
|
|
@ -108,8 +108,8 @@ fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
|
||||||
}
|
}
|
||||||
(None, _) => comps.push(Component::ParentDir),
|
(None, _) => comps.push(Component::ParentDir),
|
||||||
(Some(a), Some(b)) if comps.is_empty() && a == b => (),
|
(Some(a), Some(b)) if comps.is_empty() && a == b => (),
|
||||||
(Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
|
(Some(a), Some(Component::CurDir)) => comps.push(a),
|
||||||
(Some(_), Some(b)) if b == Component::ParentDir => return None,
|
(Some(_), Some(Component::ParentDir)) => return None,
|
||||||
(Some(a), Some(_)) => {
|
(Some(a), Some(_)) => {
|
||||||
comps.push(Component::ParentDir);
|
comps.push(Component::ParentDir);
|
||||||
for _ in itb {
|
for _ in itb {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue