-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Hint that a new Rust release may be available #4869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a7d8432
3721d36
f9a9d91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -675,7 +675,13 @@ pub async fn main( | |
| )?; | ||
| cfg.toolchain_override = matches.plus_toolchain; | ||
|
|
||
| match subcmd { | ||
| let should_notify = !matches.quiet | ||
| && !matches!( | ||
| subcmd, | ||
| RustupSubcmd::Update { .. } | RustupSubcmd::Install { .. } | ||
| ); | ||
|
Comment on lines
+678
to
+682
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could just inline this into its usage site? Splitting the logic this way is confusing.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I thought it would be better to split this out so that the logic for deciding when to notify is explicit through a named binding, which possibly should be closer to its usage site. Before correcting it, could you please give your thoughts on keeping it, but right before the usage site? |
||
|
|
||
| let result = match subcmd { | ||
| RustupSubcmd::DumpTestament => common::dump_testament(process), | ||
| RustupSubcmd::Install { opts } => update(cfg, opts, true).await, | ||
| RustupSubcmd::Uninstall { opts } => toolchain_remove(cfg, opts).await, | ||
|
|
@@ -802,7 +808,13 @@ pub async fn main( | |
| RustupSubcmd::Completions { shell, command } => { | ||
| output_completion_script(shell, command, process) | ||
| } | ||
| }; | ||
|
|
||
| if should_notify { | ||
| let _ = common::notify_release(cfg); | ||
| } | ||
|
|
||
| result | ||
| } | ||
|
|
||
| async fn default_( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
I still think it might be harmful to write this in
settings_file; I'd suggest if we were to write the timestamp to a file, it should be an individual one so that under XDG we can put it under~/.local/state/rustup/whereas the settings file should clearly be under~/.config/rustup/.cc @Cloud0310 for potential interaction/collaboration regarding XDG.
View changes since the review