Skip to content

Commit 6008cbf

Browse files
authored
Make windows_registry::VsVers non_exhaustive (#783)
1 parent 00b57f2 commit 6008cbf

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/windows_registry.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ pub fn find_tool(target: &str, tool: &str) -> Option<Tool> {
8080

8181
/// A version of Visual Studio
8282
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
83+
#[non_exhaustive]
8384
pub enum VsVers {
8485
/// Visual Studio 12 (2013)
8586
Vs12,
@@ -91,13 +92,6 @@ pub enum VsVers {
9192
Vs16,
9293
/// Visual Studio 17 (2022)
9394
Vs17,
94-
95-
/// Hidden variant that should not be matched on. Callers that want to
96-
/// handle an enumeration of `VsVers` instances should always have a default
97-
/// case meaning that it's a VS version they don't understand.
98-
#[doc(hidden)]
99-
#[allow(bad_style)]
100-
__Nonexhaustive_do_not_match_this_or_your_code_will_break,
10195
}
10296

10397
/// Find the most recent installed version of Visual Studio
@@ -106,7 +100,7 @@ pub enum VsVers {
106100
/// generator.
107101
#[cfg(not(windows))]
108102
pub fn find_vs_version() -> Result<VsVers, String> {
109-
Err(format!("not windows"))
103+
Err("not windows".to_string())
110104
}
111105

112106
/// Documented above

0 commit comments

Comments
 (0)