Skip to content

Commit

Permalink
chore(Rust): Ignore clap deprecation warnings
Browse files Browse the repository at this point in the history
These should be able to be removed when upgrading to `clap` 4.0.
This was done rather than adding numerous `#[clap(value_parser)]` attributes.
See clap-rs/clap#3822.
  • Loading branch information
nokome committed Jun 13, 2022
1 parent 1a4a8d6 commit 40bf612
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions rust/binaries/src/lib.rs
Expand Up @@ -186,6 +186,7 @@ pub async fn require_any(binaries: &[(&str, &str)]) -> Result<BinaryInstallation
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)

This comment has been minimized.

Copy link
@epage

epage Jun 15, 2022

This can now be reverted as deprecations are now off by default, see clap-rs/clap#3830 for details. When you do start working through the deprecations as part of upgrading to 4.0, we've also improved the warnings for derive users. See clap-rs/clap#3832 for examples.

This comment has been minimized.

Copy link
@nokome

nokome Jun 15, 2022

Author Member

Thank you @epage for making the effort and taking the time to comment over here. As other's have also said, you have handled this issue with much professionalism. Hats off 👏🏽 .

pub mod commands {
use std::{fs::File, io::Write, path::PathBuf};

Expand Down
1 change: 1 addition & 0 deletions rust/buildpacks/src/lib.rs
Expand Up @@ -2,4 +2,5 @@ mod buildpacks;
pub use crate::buildpacks::{Buildpacks, PACKS};

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod cli;
1 change: 1 addition & 0 deletions rust/codecs/src/lib.rs
Expand Up @@ -346,6 +346,7 @@ impl Default for Codecs {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use std::{io::Read, path::PathBuf};

Expand Down
1 change: 1 addition & 0 deletions rust/images/src/lib.rs
Expand Up @@ -8,4 +8,5 @@ pub mod snapshot;
mod utils;

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod cli;
1 change: 1 addition & 0 deletions rust/kernels/src/lib.rs
Expand Up @@ -1637,6 +1637,7 @@ fn format_duration(seconds: Option<f64>) -> String {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use cli_utils::{
clap::{self, Parser},
Expand Down
1 change: 1 addition & 0 deletions rust/parsers/src/lib.rs
Expand Up @@ -134,6 +134,7 @@ impl Default for Parsers {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use std::{fs, path::PathBuf};

Expand Down
1 change: 1 addition & 0 deletions rust/plugins/src/lib.rs
Expand Up @@ -1893,6 +1893,7 @@ pub mod config {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use super::*;
use crate::config::CONFIG;
Expand Down
1 change: 1 addition & 0 deletions rust/providers/src/lib.rs
Expand Up @@ -222,6 +222,7 @@ impl Default for Providers {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use std::path::PathBuf;

Expand Down
1 change: 1 addition & 0 deletions rust/server-next/src/lib.rs
Expand Up @@ -18,4 +18,5 @@ mod server;
pub use server::*;

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod cli;
1 change: 1 addition & 0 deletions rust/stencila/src/config.rs
Expand Up @@ -279,6 +279,7 @@ pub fn schemas() -> Result<serde_json::Value> {

/// CLI options for the `config` command
#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use cli_utils::{
clap::{self, Parser},
Expand Down
1 change: 1 addition & 0 deletions rust/stencila/src/documents.rs
Expand Up @@ -1859,6 +1859,7 @@ pub fn schemas() -> Result<serde_json::Value> {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use std::str::FromStr;

Expand Down
1 change: 1 addition & 0 deletions rust/stencila/src/lib.rs
Expand Up @@ -16,6 +16,7 @@ pub mod sources;
// Features that can be turned off

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod cli;

#[cfg(feature = "upgrade")]
Expand Down
1 change: 1 addition & 0 deletions rust/stencila/src/projects.rs
Expand Up @@ -883,6 +883,7 @@ pub mod config {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use cli_utils::{
clap::{self, Parser},
Expand Down
1 change: 1 addition & 0 deletions rust/stencila/src/server.rs
Expand Up @@ -1968,6 +1968,7 @@ pub mod config {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use std::path::PathBuf;

Expand Down
1 change: 1 addition & 0 deletions rust/stencila/src/sources.rs
Expand Up @@ -5,6 +5,7 @@ use providers::provider::WatchMode;
use sources::Source;

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use cli_utils::{
clap::{self, Parser},
Expand Down
1 change: 1 addition & 0 deletions rust/stencila/src/upgrade.rs
Expand Up @@ -178,6 +178,7 @@ pub mod config {
}

#[cfg(feature = "cli")]
#[allow(deprecated)] // Remove when using clap 4.0 (https://github.com/clap-rs/clap/issues/3822)
pub mod commands {
use cli_utils::{
clap::{self, Parser},
Expand Down

0 comments on commit 40bf612

Please sign in to comment.