Skip to content

Commit

Permalink
Fix dependency_on_unit_never_type_fallback (rust-lang/rust#123748)
Browse files Browse the repository at this point in the history
  • Loading branch information
thash committed Oct 13, 2024
1 parent 55fc6c1 commit 4763cf3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ impl std::fmt::Display for FindMethodError {

impl std::error::Error for FindMethodError {}

/*
TODO: deal with the following warning:
this function depends on never type fallback being `()`
this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
specify the types explicitly
`#[warn(dependency_on_unit_never_type_fallback)]` on by defaultrustcClick for full compiler diagnostic
exec.rs(84, 37): in edition 2024, the requirement `!: Serialize` will fail
*/
pub async fn main(args: &ExecArgs) -> Result<(), Box<dyn Error>> {
debug!("{:?}", args);

Expand All @@ -90,7 +81,8 @@ pub async fn main(args: &ExecArgs) -> Result<(), Box<dyn Error>> {
debug!("Raw result:\n{:#?}", &res);

// Print the result to stdout in pretty JSON format
println!("{}", to_string_pretty(&from_str(&res)?)?);
let json: Value = from_str(&res)?;
println!("{}", to_string_pretty(&json)?);

Ok(())
}
Expand Down

0 comments on commit 4763cf3

Please sign in to comment.