From f4e27774899c87d77cd630d9bd09654aae432b1e Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Sat, 21 Dec 2024 10:11:36 +0100 Subject: [PATCH] fix: some spelling fixes and excludes --- .vscode/settings.json | 39 +++++++++++++++++++++++++++++++++++++++ src/input.rs | 2 +- src/pool.rs | 28 ++++++++++++++-------------- 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9c391d77..f2fca507 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,4 +6,43 @@ "coverage-gutters.coverageFileNames": [ "lcov.info" ], + "cSpell.ignoreRegExpList": [ + "/\"[^\"]*\\\\u{1b}\\[[^\"]*\"/g", + "/r#\".*\\\\u001b\\[.*\"#/g", + "/\"[^\"]*\\\\x1b\\[[^\"]*\"/g" + ], + "cSpell.words": [ + "AKBNIJGHERHBNMCKJABHSDJ", + "amet", + "ampm", + "april", + "bfnrt", + "bytefmt", + "cdef", + "cpus", + "Deque", + "EVFILT", + "february", + "FFNOP", + "friday", + "ibuf", + "itoa", + "january", + "july", + "june", + "naaaa", + "nbbbb", + "november", + "october", + "orem", + "psum", + "saturday", + "stty", + "thursday", + "tuesday", + "unexp", + "unhex", + "wednesday", + "wyhash" + ] } \ No newline at end of file diff --git a/src/input.rs b/src/input.rs index d63de4fb..7e9b336b 100644 --- a/src/input.rs +++ b/src/input.rs @@ -693,7 +693,7 @@ impl BlockLines { let (buf, total) = { let block = &mut block; let mut buf = if let Some(pool) = &block.buf_pool { - pool.checkout() // TODO: implement checkin + pool.check_out() // TODO: implement check-in } else { Vec::new() }; diff --git a/src/pool.rs b/src/pool.rs index 0a89bc1b..fc5d5850 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -4,22 +4,22 @@ use crossbeam_queue::SegQueue; // --- #[allow(dead_code)] -pub trait Pool: Checkout + Checkin {} +pub trait Pool: CheckOut + CheckIn {} -impl + Checkin> Pool for U {} +impl + CheckIn> Pool for U {} // --- #[allow(dead_code)] -pub trait Checkout { - fn checkout(&self) -> T; +pub trait CheckOut { + fn check_out(&self) -> T; } // --- #[allow(dead_code)] -pub trait Checkin { - fn checkin(&self, item: T); +pub trait CheckIn { + fn check_in(&self, item: T); } // --- @@ -141,7 +141,7 @@ where } /// Returns a new or recycled T. #[inline(always)] - pub fn checkout(&self) -> T { + pub fn check_out(&self) -> T { match self.recycled.pop() { Some(item) => item, None => self.factory.new(), @@ -149,29 +149,29 @@ where } /// Recycles the given T. #[inline(always)] - pub fn checkin(&self, item: T) { + pub fn check_in(&self, item: T) { self.recycled.push(self.recycler.recycle(item)) } } -impl Checkout for SQPool +impl CheckOut for SQPool where F: Factory, R: Recycler, { #[inline(always)] - fn checkout(&self) -> T { - self.checkout() + fn check_out(&self) -> T { + self.check_out() } } -impl Checkin for SQPool +impl CheckIn for SQPool where F: Factory, R: Recycler, { #[inline(always)] - fn checkin(&self, item: T) { - self.checkin(item) + fn check_in(&self, item: T) { + self.check_in(item) } }