Skip to content

Commit 5a6d356

Browse files
emmaling27Convex, Inc.
authored andcommitted
remove unix dependency for file size (#27668)
Fix call to file size fn to not be platform dependent. GitOrigin-RevId: 0e47d9db959d4e86fb4c5c24867ae8fb03f911b3
1 parent ddd0b23 commit 5a6d356

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crates/search/src/incremental_index.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::{
44
BTreeSet,
55
},
66
iter::zip,
7-
os::unix::fs::MetadataExt,
87
path::{
98
Path,
109
PathBuf,
@@ -470,7 +469,7 @@ pub async fn build_new_segment<RT: Runtime>(
470469

471470
fn get_size(path: &PathBuf) -> anyhow::Result<u64> {
472471
if path.is_file() {
473-
return Ok(path.metadata()?.size());
472+
return Ok(path.metadata()?.len());
474473
}
475474
std::fs::read_dir(path)?.try_fold(0, |acc, curr| Ok(acc + get_size(&curr?.path())?))
476475
}

0 commit comments

Comments
 (0)