Skip to content

Commit d9322d0

Browse files
committed
Remove now-unused 'LtsRequirement' tag
1 parent 21c8fa0 commit d9322d0

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

crates/volta-core/src/tool/node/resolve.rs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub fn resolve(matching: VersionSpec, session: &mut Session) -> Fallible<Version
4444
VersionSpec::Exact(version) => Ok(version),
4545
VersionSpec::None | VersionSpec::Tag(VersionTag::Lts) => resolve_lts(hooks),
4646
VersionSpec::Tag(VersionTag::Latest) => resolve_latest(hooks),
47-
VersionSpec::Tag(VersionTag::LtsRequirement(req)) => resolve_lts_semver(req, hooks),
4847
// Node doesn't have "tagged" versions (apart from 'latest' and 'lts'), so custom tags will always be an error
4948
VersionSpec::Tag(VersionTag::Custom(tag)) => {
5049
Err(ErrorKind::NodeVersionNotFound { matching: tag }.into())
@@ -135,55 +134,6 @@ fn resolve_semver(matching: VersionReq, hooks: Option<&ToolHooks<Node>>) -> Fall
135134
}
136135
}
137136

138-
fn resolve_lts_semver(matching: VersionReq, hooks: Option<&ToolHooks<Node>>) -> Fallible<Version> {
139-
// ISSUE #34: also make sure this OS is available for this version
140-
let url = match hooks {
141-
Some(&ToolHooks {
142-
index: Some(ref hook),
143-
..
144-
}) => {
145-
debug!("Using node.index hook to determine node index URL");
146-
hook.resolve("index.json")?
147-
}
148-
_ => public_node_version_index(),
149-
};
150-
151-
let first_pass = match_node_version(
152-
&url,
153-
|&NodeEntry {
154-
ref version, lts, ..
155-
}| { lts && matching.matches(version) },
156-
)?;
157-
158-
match first_pass {
159-
Some(version) => {
160-
debug!(
161-
"Found LTS node@{} matching requirement '{}' from {}",
162-
version, matching, url
163-
);
164-
return Ok(version);
165-
}
166-
None => debug!(
167-
"No LTS version found matching requirement '{}', checking for non-LTS",
168-
matching
169-
),
170-
};
171-
172-
match match_node_version(&url, |NodeEntry { version, .. }| matching.matches(version))? {
173-
Some(version) => {
174-
debug!(
175-
"Found non-LTS node@{} matching requirement '{}' from {}",
176-
version, matching, url
177-
);
178-
Ok(version)
179-
}
180-
None => Err(ErrorKind::NodeVersionNotFound {
181-
matching: matching.to_string(),
182-
}
183-
.into()),
184-
}
185-
}
186-
187137
fn match_node_version(
188138
url: &str,
189139
predicate: impl Fn(&NodeEntry) -> bool,

crates/volta-core/src/version/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ pub enum VersionTag {
3333

3434
/// An arbitrary tag version
3535
Custom(String),
36-
37-
/// An internal tag that represents the latest LTS version which matches a set of requirements
38-
LtsRequirement(VersionReq),
3936
}
4037

4138
impl fmt::Display for VersionSpec {
@@ -55,7 +52,6 @@ impl fmt::Display for VersionTag {
5552
VersionTag::Latest => write!(f, "latest"),
5653
VersionTag::Lts => write!(f, "lts"),
5754
VersionTag::Custom(s) => s.fmt(f),
58-
VersionTag::LtsRequirement(req) => req.fmt(f),
5955
}
6056
}
6157
}

0 commit comments

Comments
 (0)