浏览代码

fix: correct typos and improve comments in accounts-db module (#7401)

* fix typo

* Update hot.rs

* Update meta.rs

* Update file_creator.rs
Snezhkko 3 月之前
父节点
当前提交
04a8483ae7

+ 1 - 1
accounts-db/benches/bench_lock_accounts.rs

@@ -38,7 +38,7 @@ fn create_test_transactions(lock_count: usize, read_conflicts: bool) -> Vec<Sani
         #[allow(clippy::needless_range_loop)]
         #[allow(clippy::needless_range_loop)]
         for i in 0..lock_count {
         for i in 0..lock_count {
             // `lock_accounts()` distinguishes writable from readonly, so give transactions an even split
             // `lock_accounts()` distinguishes writable from readonly, so give transactions an even split
-            // signer doesnt matter for locking but `sanitize()` expects to see at least one
+            // signer doesn't matter for locking but `sanitize()` expects to see at least one
             let account_meta = if i == 0 {
             let account_meta = if i == 0 {
                 AccountMeta::new(Pubkey::new_unique(), true)
                 AccountMeta::new(Pubkey::new_unique(), true)
             } else if i % 2 == 0 {
             } else if i % 2 == 0 {

+ 1 - 1
accounts-db/src/io_uring/file_creator.rs

@@ -154,7 +154,7 @@ impl<B> FileCreator for IoUringFileCreator<'_, B> {
 }
 }
 
 
 impl<B> IoUringFileCreator<'_, B> {
 impl<B> IoUringFileCreator<'_, B> {
-    /// Schedule opening file at `path` with `mode` permissons.
+    /// Schedule opening file at `path` with `mode` permissions.
     ///
     ///
     /// Returns key that can be used for scheduling writes for it.
     /// Returns key that can be used for scheduling writes for it.
     fn open(
     fn open(

+ 2 - 2
accounts-db/src/tiered_storage/hot.rs

@@ -1226,12 +1226,12 @@ mod tests {
 
 
     #[test]
     #[test]
     #[should_panic(expected = "would exceed accounts blocks offset boundary")]
     #[should_panic(expected = "would exceed accounts blocks offset boundary")]
-    fn test_get_acount_meta_from_offset_out_of_bounds() {
+    fn test_get_account_meta_from_offset_out_of_bounds() {
         // Generate a new temp path that is guaranteed to NOT already have a file.
         // Generate a new temp path that is guaranteed to NOT already have a file.
         let temp_dir = TempDir::new().unwrap();
         let temp_dir = TempDir::new().unwrap();
         let path = temp_dir
         let path = temp_dir
             .path()
             .path()
-            .join("test_get_acount_meta_from_offset_out_of_bounds");
+            .join("test_get_account_meta_from_offset_out_of_bounds");
 
 
         let footer = TieredStorageFooter {
         let footer = TieredStorageFooter {
             account_meta_format: AccountMetaFormat::Hot,
             account_meta_format: AccountMetaFormat::Hot,

+ 1 - 1
accounts-db/src/tiered_storage/meta.rs

@@ -27,7 +27,7 @@ const _: () = assert!(std::mem::size_of::<AccountMetaFlags>() == 4);
 /// A trait that allows different implementations of the account meta that
 /// A trait that allows different implementations of the account meta that
 /// support different tiers of the accounts storage.
 /// support different tiers of the accounts storage.
 pub trait TieredAccountMeta: Sized {
 pub trait TieredAccountMeta: Sized {
-    /// Constructs a TieredAcountMeta instance.
+    /// Constructs a TieredAccountMeta instance.
     fn new() -> Self;
     fn new() -> Self;
 
 
     /// A builder function that initializes lamports.
     /// A builder function that initializes lamports.