Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordworms committed Jul 22, 2024
1 parent fde9d7a commit a09bb05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions datafusion/core/src/datasource/file_format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ impl DefaultFileType {
}
}

/// get a [FileFormatFactory] struct
pub fn get_format_factory(&self) -> Arc<dyn FileFormatFactory> {
self.file_format_factory.clone()
/// get a reference to the inner [FileFormatFactory] struct
pub fn as_format_factory(&self) -> &Arc<dyn FileFormatFactory> {
&self.file_format_factory
}
}

Expand Down
2 changes: 1 addition & 1 deletion datafusion/proto/tests/cases/roundtrip_logical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ async fn roundtrip_logical_plan_copy_to_csv() -> Result<()> {
.downcast_ref::<DefaultFileType>()
.unwrap();

let format_factory = file_type.get_format_factory();
let format_factory = file_type.as_format_factory();
let csv_factory = format_factory
.as_ref()
.as_any()
Expand Down

0 comments on commit a09bb05

Please sign in to comment.