Skip to content

Commit

Permalink
fix: some spelling fixes and excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus committed Dec 21, 2024
1 parent ab279ca commit f4e2777
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 15 deletions.
39 changes: 39 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
2 changes: 1 addition & 1 deletion src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ impl BlockLines<IndexedInput> {
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

Check warning on line 696 in src/input.rs

View check run for this annotation

Codecov / codecov/patch

src/input.rs#L696

Added line #L696 was not covered by tests
} else {
Vec::new()
};
Expand Down
28 changes: 14 additions & 14 deletions src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ use crossbeam_queue::SegQueue;
// ---

#[allow(dead_code)]
pub trait Pool<T>: Checkout<T> + Checkin<T> {}
pub trait Pool<T>: CheckOut<T> + CheckIn<T> {}

impl<T, U: Checkout<T> + Checkin<T>> Pool<T> for U {}
impl<T, U: CheckOut<T> + CheckIn<T>> Pool<T> for U {}

// ---

#[allow(dead_code)]
pub trait Checkout<T> {
fn checkout(&self) -> T;
pub trait CheckOut<T> {
fn check_out(&self) -> T;
}

// ---

#[allow(dead_code)]
pub trait Checkin<T> {
fn checkin(&self, item: T);
pub trait CheckIn<T> {
fn check_in(&self, item: T);
}

// ---
Expand Down Expand Up @@ -141,37 +141,37 @@ where
}
/// Returns a new or recycled T.
#[inline(always)]
pub fn checkout(&self) -> T {
pub fn check_out(&self) -> T {

Check warning on line 144 in src/pool.rs

View check run for this annotation

Codecov / codecov/patch

src/pool.rs#L144

Added line #L144 was not covered by tests
match self.recycled.pop() {
Some(item) => item,
None => self.factory.new(),
}
}
/// Recycles the given T.
#[inline(always)]
pub fn checkin(&self, item: T) {
pub fn check_in(&self, item: T) {

Check warning on line 152 in src/pool.rs

View check run for this annotation

Codecov / codecov/patch

src/pool.rs#L152

Added line #L152 was not covered by tests
self.recycled.push(self.recycler.recycle(item))
}
}

impl<T, F, R> Checkout<T> for SQPool<T, F, R>
impl<T, F, R> CheckOut<T> for SQPool<T, F, R>
where
F: Factory<T>,
R: Recycler<T>,
{
#[inline(always)]
fn checkout(&self) -> T {
self.checkout()
fn check_out(&self) -> T {
self.check_out()

Check warning on line 164 in src/pool.rs

View check run for this annotation

Codecov / codecov/patch

src/pool.rs#L163-L164

Added lines #L163 - L164 were not covered by tests
}
}

impl<T, F, R> Checkin<T> for SQPool<T, F, R>
impl<T, F, R> CheckIn<T> for SQPool<T, F, R>
where
F: Factory<T>,
R: Recycler<T>,
{
#[inline(always)]
fn checkin(&self, item: T) {
self.checkin(item)
fn check_in(&self, item: T) {
self.check_in(item)

Check warning on line 175 in src/pool.rs

View check run for this annotation

Codecov / codecov/patch

src/pool.rs#L174-L175

Added lines #L174 - L175 were not covered by tests
}
}

0 comments on commit f4e2777

Please sign in to comment.