Skip to content

Commit

Permalink
Fixes unreachable! calls in Rust 1.59+
Browse files Browse the repository at this point in the history
Starting in Rust 1.59, calls to the `unreachable!` macro no longer
accept string variables as their first parameter. This brings their
behavior in line with macros like `println!`, `format!`, and `write!`.

See: rust-lang/rust#94475
  • Loading branch information
zslayton committed Mar 2, 2022
1 parent 5bdfc6c commit 4019ae3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/bin/ion/commands/beta/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn run(_command_name: &str, matches: &ArgMatches<'static>) -> Result<()> {
"The requested beta command ('{}') is not supported and clap did not generate an error message.",
command_name
);
unreachable!(message);
unreachable!("{}", message);
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/bin/ion/commands/beta/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn run(_command_name: &str, matches: &ArgMatches<'static>) -> Result<()> {
"The requested schema command ('{}') is not supported and clap did not generate an error message.",
command_name
);
unreachable!(message);
unreachable!("{}", message);
}
Ok(())
}
Expand All @@ -46,4 +46,4 @@ pub fn app() -> CommandConfig {
"The 'schema' command is a namespace for commands that are related to schema sandbox",
)
.subcommands(schema_subcommands())
}
}
2 changes: 1 addition & 1 deletion src/bin/ion/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() -> Result<()> {
"The requested command ('{}') is not supported and clap did not generate an error message.",
command_name
);
unreachable!(message);
unreachable!("{}", message);
}
Ok(())
}

0 comments on commit 4019ae3

Please sign in to comment.