diff --git a/pageserver/src/storage_sync/download.rs b/pageserver/src/storage_sync/download.rs index 04368b6783..12b858fb57 100644 --- a/pageserver/src/storage_sync/download.rs +++ b/pageserver/src/storage_sync/download.rs @@ -129,7 +129,6 @@ pub async fn download_layer_file<'a>( Ok(bytes_amount) } - const TEMP_DOWNLOAD_EXTENSION: &str = "temp_download"; pub fn is_temp_download_file(path: &Path) -> bool { @@ -236,14 +235,14 @@ pub async fn download_index_part( &mut index_part_download.download_stream, &mut index_part_bytes, ) - .await - .with_context(|| { - format!( - "Failed to download an index part into file '{}'", - index_part_path.display() - ) - }) - .map_err(DownloadError::Other)?; + .await + .with_context(|| { + format!( + "Failed to download an index part into file '{}'", + index_part_path.display() + ) + }) + .map_err(DownloadError::Other)?; let index_part: IndexPart = serde_json::from_slice(&index_part_bytes) .with_context(|| { diff --git a/pageserver/src/storage_sync/upload.rs b/pageserver/src/storage_sync/upload.rs index 261a954fd9..b03a0f6ce7 100644 --- a/pageserver/src/storage_sync/upload.rs +++ b/pageserver/src/storage_sync/upload.rs @@ -37,9 +37,7 @@ pub(super) async fn upload_index_part<'a>( &index_part_path, ) .await - .with_context(|| { - format!("Failed to upload index part for '{tenant_id} / {timeline_id}'") - }) + .with_context(|| format!("Failed to upload index part for '{tenant_id} / {timeline_id}'")) } /// Attempts to upload given layer files. @@ -88,7 +86,9 @@ pub(super) async fn upload_timeline_layer( // this is a silly state we would like to avoid } - let fs_size = usize::try_from(fs_size).with_context(|| format!("File {source_path:?} size {fs_size} could not be converted to usize"))?; + let fs_size = usize::try_from(fs_size).with_context(|| { + format!("File {source_path:?} size {fs_size} could not be converted to usize") + })?; storage .upload(Box::new(source_file), fs_size, &storage_path, None) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 1ccd1570bf..f01ab2bfe2 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -501,8 +501,14 @@ impl Tenant { // Sanity check: a timeline should have some content. anyhow::ensure!( - ancestor.is_some() || - timeline.layers.read().unwrap().iter_historic_layers().next().is_some(), + ancestor.is_some() + || timeline + .layers + .read() + .unwrap() + .iter_historic_layers() + .next() + .is_some(), "Timeline has no ancestor and no layer files" );