GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add error for `volta install 10` by bakkot · Pull Request #1020 · volta-cli/volta

Conversation

@bakkot

@bakkot bakkot commented Aug 27, 2021

Copy link
Copy Markdown
Contributor

Fixes #1016.

I didn't document this anywhere, since it seems like something you don't need to know about until you've already tripped over it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bakkot
Add error for volta install 10
d6587e6
@bakkot bakkot mentioned this pull request Aug 27, 2021
warn for or forbid volta install 10 #1016
Closed
charlespierce
charlespierce requested changes Aug 27, 2021
View reviewed changes

@charlespierce charlespierce left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! A couple of small tweaks but looks like a great usability improvement!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread crates/volta-core/src/error/kind.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/volta-core/src/tool/serial.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bakkot
address comments
7b60a42
charlespierce
charlespierce approved these changes Aug 27, 2021
View reviewed changes

@charlespierce charlespierce left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bakkot
bare _
a1e26a7
bakkot
bakkot commented Aug 27, 2021
View reviewed changes
Comment thread crates/volta-core/src/tool/serial.rs Outdated
name: name.as_ref().to_string(),
version: maybe_version.as_ref().to_string(),
match (args.next(), args.next(), args.next()) {
(Some(maybe_version), None, None) => {

@bakkot bakkot Aug 27, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you'll take a random question while I'm here (I'm new to rust) - would it be more idiomatic to have

(Some(maybe_version), None, None) if is_version_like(maybe_version.as_ref()) => {

rather than

(Some(maybe_version), None, None) => {
  if is_version_like(maybe_version.as_ref()) {

?

(In the case that nothing else is going to match anyway so that they have the same semantics.)

Also, if it is, would it be more idiomatic to have the match itself provide the return value, i.e. get rid of the returns and make the _ branch be _ => Ok(())?

Happy to push up a commit with that change if it would be an improvement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@charlespierce charlespierce Aug 28, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great question! In my experience, it usually comes down to readability: I find the <pattern> if <predicate> => can very easily get verbose enough that it's more difficult to read than <pattern> => if <predicate>. For your second question, yes if you use the predicate matching it would be more idiomatic to have the match provide the value directly.

In this case, I would probably lean that doing predicate matching is slightly cleaner, but it's not anything that would block a PR. So if you'd like to (and have the time to) add another commit, that would be a bonus! But if not no worries and I'm happy to merge as is 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bakkot bakkot Aug 28, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the response! Pushed up a commit doing that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bakkot
refactor
588c79f
@charlespierce

charlespierce commented Aug 28, 2021

Copy link
Copy Markdown
Contributor

Awesome, thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@charlespierce
charlespierce merged commit 98dfa2c into volta-cli:main Aug 28, 2021
@bakkot
bakkot deleted the install-version-number branch August 28, 2021 20:02
@bakkot

bakkot commented Sep 2, 2021

Copy link
Copy Markdown
Contributor Author

@charlespierce Any chance of cutting a release with this change?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@charlespierce

charlespierce commented Sep 7, 2021

Copy link
Copy Markdown
Contributor

@bakkot Done! Released as part of 1.0.5!

bakkot reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@charlespierce charlespierce charlespierce approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

warn for or forbid volta install 10

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@bakkot @charlespierce
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.