From 0f6f73ecf3c2ebfe5b218edc0765886ccdca6f7f Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 5 Jul 2024 12:53:30 +0100 Subject: [PATCH] [red-knot] Require that `FileSystem` objects implement `Debug` (#12204) --- crates/ruff_db/src/file_system.rs | 2 +- crates/ruff_db/src/file_system/os.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_db/src/file_system.rs b/crates/ruff_db/src/file_system.rs index 740bbec560696..1e6e90059219b 100644 --- a/crates/ruff_db/src/file_system.rs +++ b/crates/ruff_db/src/file_system.rs @@ -21,7 +21,7 @@ pub type Result = std::io::Result; /// * Accessing unsaved or even untitled files in the LSP use case /// * Testing with an in-memory file system /// * Running Ruff in a WASM environment without needing to stub out the full `std::fs` API. -pub trait FileSystem { +pub trait FileSystem: std::fmt::Debug { /// Reads the metadata of the file or directory at `path`. fn metadata(&self, path: &FileSystemPath) -> Result; diff --git a/crates/ruff_db/src/file_system/os.rs b/crates/ruff_db/src/file_system/os.rs index 057334c5b7f9a..d3f5faf40e9ac 100644 --- a/crates/ruff_db/src/file_system/os.rs +++ b/crates/ruff_db/src/file_system/os.rs @@ -2,7 +2,7 @@ use filetime::FileTime; use crate::file_system::{FileSystem, FileSystemPath, FileType, Metadata, Result}; -#[derive(Default)] +#[derive(Default, Debug)] pub struct OsFileSystem; impl OsFileSystem {