Skip to content

Commit c1fea0e

Browse files
Merge pull request #916 from charlespierce/remove_lts_requirement
[Small] Remove now-unused 'LtsRequirement' tag
2 parents ef8a198 + d9322d0 commit c1fea0e

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())
@@ -134,55 +133,6 @@ fn resolve_semver(matching: VersionReq, hooks: Option<&ToolHooks<Node>>) -> Fall
134133
}
135134
}
136135

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