Skip to content

Commit 3d6ce60

Browse files
author
Nichol Yip
committed
Fixed linting errors and removed unused commented code.
Signed-off-by: Nichol Yip <[email protected]>
1 parent c5ef947 commit 3d6ce60

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

crates/spk-schema/src/environ.rs

-11
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,6 @@ impl EnvOp {
106106
Self::Set(op) => op.tcsh_source(),
107107
}
108108
}
109-
110-
// /// Returns the lint message for the given EnvOp
111-
// pub fn lints(&self, unknown_key: &str) -> String {
112-
// match self {
113-
// Self::Append(op) => op.generate_lints(unknown_key),
114-
// Self::Comment(op) => op.generate_lints(unknown_key),
115-
// Self::Prepend(op) => op.generate_lints(unknown_key),
116-
// Self::Priority(op) => op.generate_lints(unknown_key),
117-
// Self::Set(op) => op.generate_lints(unknown_key),
118-
// }
119-
// }
120109
}
121110

122111
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize)]

crates/spk-schema/src/source_spec.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,26 @@ impl Lints for SourceSpecVisitor {
8585

8686
impl From<SourceSpecVisitor> for SourceSpec {
8787
fn from(value: SourceSpecVisitor) -> Self {
88-
if !value.path.is_none() {
88+
if value.path.is_some() {
8989
SourceSpec::Local(LocalSource {
9090
path: value.path.expect("a path source"),
9191
exclude: value.exclude.unwrap_or(LocalSource::default_exclude()),
9292
filter: value.filter.unwrap_or(LocalSource::default_filter()),
9393
subdir: value.subdir,
9494
})
95-
} else if !value.git.is_none() {
95+
} else if value.git.is_some() {
9696
SourceSpec::Git(GitSource {
9797
git: value.git.expect("a git source"),
9898
reference: value.reference.unwrap_or(String::from("")),
9999
depth: value.depth.unwrap_or(default_git_clone_depth()),
100100
subdir: value.subdir,
101101
})
102-
} else if !value.script.is_none() {
102+
} else if value.script.is_some() {
103103
SourceSpec::Script(ScriptSource {
104104
script: value.script.expect("a script source"),
105105
subdir: value.subdir,
106106
})
107-
} else if !value.tar.is_none() {
107+
} else if value.tar.is_some() {
108108
SourceSpec::Tar(TarSource {
109109
tar: value.tar.expect("a tar source"),
110110
subdir: value.subdir,

0 commit comments

Comments
 (0)