clippy: remove warning when not using watchman feature

I keep seeing the one in lib/ when running tests in VS Code, but I also
fixed the warnings in watchman.rs for good measure.
This commit is contained in:
Ilya Grigoriev 2024-06-28 22:40:11 -07:00
parent 1eebbe57c0
commit c563ea8b29
2 changed files with 7 additions and 2 deletions

View file

@ -12,12 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[cfg(feature = "watchman")]
use std::any::Any;
use std::fmt::Debug;
#[cfg(feature = "watchman")]
use std::io::Write as _;
use clap::Subcommand;
#[cfg(feature = "watchman")]
use jj_lib::fsmonitor::{FsmonitorSettings, WatchmanConfig};
#[cfg(feature = "watchman")]
use jj_lib::local_working_copy::LocalWorkingCopy;
use crate::cli_util::CommandHelper;
@ -131,6 +135,7 @@ pub fn cmd_debug_watchman(
))
}
#[cfg(feature = "watchman")]
fn check_local_disk_wc(x: &dyn Any) -> Result<&LocalWorkingCopy, CommandError> {
x.downcast_ref()
.ok_or_else(|| user_error("This command requires a standard local-disk working copy"))

View file

@ -47,9 +47,9 @@ use crate::backend::{
use crate::commit::Commit;
use crate::conflicts::{self, materialize_tree_value, MaterializedTreeValue};
use crate::file_util::{check_symlink_support, try_symlink};
use crate::fsmonitor::FsmonitorSettings;
#[cfg(feature = "watchman")]
use crate::fsmonitor::watchman;
use crate::fsmonitor::{FsmonitorSettings, WatchmanConfig};
use crate::fsmonitor::{watchman, WatchmanConfig};
use crate::gitignore::GitIgnoreFile;
use crate::lock::FileLock;
use crate::matchers::{