Skip to content

Commit a09bb05

Browse files
committed
optimize code
1 parent fde9d7a commit a09bb05

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

datafusion/core/src/datasource/file_format/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ impl DefaultFileType {
155155
}
156156
}
157157

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

datafusion/proto/tests/cases/roundtrip_logical_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ async fn roundtrip_logical_plan_copy_to_csv() -> Result<()> {
487487
.downcast_ref::<DefaultFileType>()
488488
.unwrap();
489489

490-
let format_factory = file_type.get_format_factory();
490+
let format_factory = file_type.as_format_factory();
491491
let csv_factory = format_factory
492492
.as_ref()
493493
.as_any()

0 commit comments

Comments
 (0)