Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix typo #1459

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/object/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ flags! {
///
/// At user side, we will allow user to query the object metadata. If
/// the meta has been stored, we will return directly. If no, we will
/// call `stat` internally to fecth the metadata.
/// call `stat` internally to fetch the metadata.
pub enum ObjectMetakey: u64 {
/// The special object metadata key that used to mark this object
/// already contains all metadata.
Expand Down
4 changes: 2 additions & 2 deletions src/object/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl Object {
///
/// # Notes
///
/// - The returning contnet's length may be smaller than the range specified.
/// - The returning content's length may be smaller than the range specified.
///
/// # Examples
///
Expand Down Expand Up @@ -445,7 +445,7 @@ impl Object {
///
/// # Notes
///
/// - The returning contnet's length may be smaller than the range specified.
/// - The returning content's length may be smaller than the range specified.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion src/object/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl AsyncWrite for ObjectWriter {
self.state = State::Close(Box::pin(fut));
}
State::Write(_) => {
unreachable!("invlia state of writer: poll_close with State::Write")
unreachable!("invalid state of writer: poll_close with State::Write")
}
State::Close(fut) => match ready!(fut.poll_unpin(cx)) {
Ok(w) => {
Expand Down
2 changes: 1 addition & 1 deletion src/raw/accessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub trait Accessor: Send + Sync + Debug + Unpin + 'static {
/// # Behavior
///
/// - Input path MUST be file path, DON'T NEED to check object mode.
/// - The returning contnet length may be smaller than the range specified.
/// - The returning content length may be smaller than the range specified.
async fn read(&self, path: &str, args: OpRead) -> Result<(RpRead, Self::Reader)> {
let (_, _) = (path, args);

Expand Down
2 changes: 1 addition & 1 deletion src/raw/http_util/bytes_content_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::Result;
///
/// BytesContentRange implements `len()` but not `is_empty()` because it's useless.
/// - When BytesContentRange's range is known, it must be non-empty.
/// - When BytesContentRange's range is no known, we don't know whethre it's empty.
/// - When BytesContentRange's range is no known, we don't know whether it's empty.
#[allow(clippy::len_without_is_empty)]
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BytesContentRange(
Expand Down
2 changes: 1 addition & 1 deletion src/raw/http_util/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl DnsCache {
// entire cache to make more space.
//
// As described in DnsCache's doc, this limit should never be reached.
// We expect there only few entries holded in cache.
// We expect there only few entries held in cache.
if guard.len() >= self.limits {
guard.clear()
}
Expand Down
2 changes: 1 addition & 1 deletion src/raw/oio/into_reader/by_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<A: Accessor> oio::Read for RangeReader<A> {
// TODO: make this value configurable
if seek_pos > self.cur && seek_pos - self.cur < 1024 * 1024 {
// 212992 is the default read mem buffer of archlinux.
// Ideally we should make this congiurable.
// Ideally we should make this configurable.
//
// TODO: make this value configurable
let consume = cmp::min((seek_pos - self.cur) as usize, 212992);
Expand Down
2 changes: 1 addition & 1 deletion src/raw/oio/into_streamable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ mod tests {
}

#[test]
fn test_into_stream_blocing() {
fn test_into_stream_blocking() {
use oio::BlockingRead;

let mut rng = ThreadRng::default();
Expand Down
4 changes: 2 additions & 2 deletions src/raw/oio/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl Read for () {
}
}

/// `Box<dyn Read>` won't implement `Read` automanticly. To make Reader
/// `Box<dyn Read>` won't implement `Read` automatically. To make Reader
/// work as expected, we must add this impl.
impl<T: Read + ?Sized> Read for Box<T> {
fn poll_read(&mut self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>> {
Expand Down Expand Up @@ -327,7 +327,7 @@ impl BlockingRead for () {
}
}

/// `Box<dyn BlockingRead>` won't implement `BlockingRead` automanticly.
/// `Box<dyn BlockingRead>` won't implement `BlockingRead` automatically.
/// To make BlockingReader work as expected, we must add this impl.
impl<T: BlockingRead + ?Sized> BlockingRead for Box<T> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
Expand Down
4 changes: 2 additions & 2 deletions src/raw/oio/to_hierarchy_pager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn to_hierarchy_pager<P>(pager: P, path: &str) -> ToHierarchyPager<P> {
///
/// # Notes
///
/// ToHierarchyPager filter entries after fecth entries. So it's possible
/// ToHierarchyPager filter entries after fetch entries. So it's possible
/// to return an empty vec. It doesn't mean the all pages have been
/// returned.
///
Expand All @@ -58,7 +58,7 @@ impl<P> ToHierarchyPager<P> {
.filter_map(|mut e| {
// If path is not started with prefix, drop it.
//
// Idealy, it should never happen. But we just tolerate
// Ideally, it should never happen. But we just tolerate
// this state.
if !e.path().starts_with(&self.path) {
return None;
Expand Down
4 changes: 2 additions & 2 deletions src/raw/oio/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Write for () {
}
}

/// `Box<dyn Write>` won't implement `Write` automanticly. To make Writer
/// `Box<dyn Write>` won't implement `Write` automatically. To make Writer
/// work as expected, we must add this impl.
#[async_trait]
impl<T: Write + ?Sized> Write for Box<T> {
Expand Down Expand Up @@ -169,7 +169,7 @@ impl BlockingWrite for () {
}
}

/// `Box<dyn BlockingWrite>` won't implement `BlockingWrite` automanticly.
/// `Box<dyn BlockingWrite>` won't implement `BlockingWrite` automatically.
/// To make BlockingWriter work as expected, we must add this impl.
impl<T: BlockingWrite + ?Sized> BlockingWrite for Box<T> {
fn write(&mut self, bs: Bytes) -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion src/raw/rps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl RpBatch {
}
}

/// Batch results of `bacth` operations.
/// Batch results of `batch` operations.
pub enum BatchedResults {
/// results of delete batch operation
Delete(Vec<(String, Result<RpDelete>)>),
Expand Down
2 changes: 1 addition & 1 deletion src/services/fs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl FsBuilder {
/// behavior is consistent. By enable path check, we can make sure
/// fs will behave the same as other services.
///
/// Enabling this feature will lead to etra metadata call in all
/// Enabling this feature will lead to extra metadata call in all
/// operations.
pub fn enable_path_check(&mut self) -> &mut Self {
self.enable_path_check = true;
Expand Down
6 changes: 3 additions & 3 deletions src/services/gcs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl GcsBuilder {
/// Set the GCS service account.
///
/// service account will be used for fetch token from vm metadata.
/// If not set, we will try to fecth with `default` service account.
/// If not set, we will try to fetch with `default` service account.
pub fn service_account(&mut self, service_account: &str) -> &mut Self {
if !service_account.is_empty() {
self.service_account = Some(service_account.to_string())
Expand Down Expand Up @@ -195,7 +195,7 @@ impl GcsBuilder {
self
}

/// Specify the signer directly instead of builling by OpenDAL.
/// Specify the signer directly instead of building by OpenDAL.
///
/// If signer is specified, the following settings will not be used
/// any more:
Expand Down Expand Up @@ -648,7 +648,7 @@ struct GetObjectJsonResponse {
md5_hash: String,
/// Content type of this object.
///
/// For examlpe: `"contentType": "image/png",`
/// For example: `"contentType": "image/png",`
content_type: String,
}

Expand Down
2 changes: 1 addition & 1 deletion src/services/moka/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl Builder for MokaBuilder {
let mut builder: CacheBuilder<String, Vec<u8>, _> =
SegmentedCache::builder(self.num_segments.unwrap_or(1))
.thread_pool_enabled(self.thread_pool_enabled.unwrap_or(false));
// Use entries's bytes as capacity weigher.
// Use entries' bytes as capacity weigher.
builder = builder.weigher(|k, v| (k.len() + v.len()) as u32);
if let Some(v) = &self.name {
builder = builder.name(v);
Expand Down