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

feat(fix): typos, restruct #2

Merged
merged 3 commits into from
Mar 7, 2024
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
10 changes: 6 additions & 4 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version: 2
updates:

- package-ecosystem: cargo
directory: /
- package-ecosystem: "cargo"
directory: "/"
schedule:
day: monday
interval: weekly
interval: "weekly"
timezone: "Europe/Warsaw"
day: "friday"
time: "18:00"
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions countio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

[package]
name = "countio"
version = "0.2.16"
version = "0.2.17"
readme = "./README.md"

edition = { workspace = true }
license = { workspace = true }
authors = { workspace = true }

repository = "https://github.com/xwde/kit/countio"
homepage = "https://github.com/xwde/kit/countio"
repository = "https://github.com/spire-rs/kit/countio"
homepage = "https://github.com/spire-rs/kit/countio"
documentation = "https://docs.rs/countio"
categories = ["parsing", "asynchronous"]
keywords = ["byte", "tokio", "futures", "parsing"]
Expand All @@ -28,11 +28,11 @@ path = "./lib.rs"

[features]
default = ["std"]
full = ["std", "async-tokio", "async-futures"]
full = ["std", "tokio", "futures"]

std = []
async-tokio = ["dep:tokio"]
async-futures = ["dep:futures-io"]
tokio = ["dep:tokio"]
futures = ["dep:futures-io"]

[dependencies]
tokio = { workspace = true, optional = true }
Expand Down
7 changes: 0 additions & 7 deletions countio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@
[here](https://github.com/spire-rs).**

[action-badge]: https://img.shields.io/github/actions/workflow/status/spire-rs/kit/build.yaml?branch=main&label=build&logo=github&style=flat-square

[action-url]: https://github.com/spire-rs/kit/actions/workflows/build.yaml

[crates-badge]: https://img.shields.io/crates/v/countio.svg?logo=rust&style=flat-square

[crates-url]: https://crates.io/crates/countio

[docs-badge]: https://img.shields.io/docsrs/countio?logo=Docs.rs&style=flat-square

[docs-url]: http://docs.rs/countio

[coverage-badge]: https://img.shields.io/codecov/c/github/spire-rs/kit?logo=codecov&logoColor=white&style=flat-square

[coverage-url]: https://app.codecov.io/gh/spire-rs/kit

The wrapper struct to enable byte counting for `std::io::Read`,
Expand Down
4 changes: 2 additions & 2 deletions countio/counter/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ impl<D: AsyncSeek + Unpin> AsyncSeek for Counter<D> {

#[cfg(test)]
mod test {
use super::*;

use futures_util::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt};
use futures_util::io::{BufReader, BufWriter};

use super::*;

#[futures_test::test]
async fn reader() -> Result<()> {
let reader = "Hello World!".as_bytes();
Expand Down
8 changes: 4 additions & 4 deletions countio/counter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
mod stdlib;

#[cfg(feature = "async-futures")]
#[cfg_attr(docsrs, doc(cfg(feature = "async-futures")))]
#[cfg(feature = "futures")]
#[cfg_attr(docsrs, doc(cfg(feature = "futures")))]
mod futures;

#[cfg(feature = "async-tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "async-tokio")))]
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
mod tokio;

/// The `Counter<D>` struct adds byte counting to any reader or writer.
Expand Down
10 changes: 5 additions & 5 deletions countio/counter/stdlib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fmt::{Debug, Formatter};
use std::fmt;
use std::io::{BufRead, Read, Seek, Write};
use std::io::{Result, SeekFrom};

Expand Down Expand Up @@ -41,8 +41,8 @@ impl<D: Seek> Seek for Counter<D> {
}
}

impl<D: Debug> Debug for Counter<D> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
impl<D: fmt::Debug> fmt::Debug for Counter<D> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Counter")
.field("inner", &self.inner)
.field("read", &self.reader_bytes)
Expand All @@ -53,10 +53,10 @@ impl<D: Debug> Debug for Counter<D> {

#[cfg(test)]
mod test {
use super::*;

use std::io::{BufReader, BufWriter};

use super::*;

#[test]
fn reader() -> Result<()> {
let reader = "Hello World!".as_bytes();
Expand Down
4 changes: 2 additions & 2 deletions countio/counter/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ impl<D: AsyncSeek + Unpin> AsyncSeek for Counter<D> {

#[cfg(test)]
mod tests {
use super::*;

use tokio::io::{AsyncBufReadExt, AsyncWriteExt};
use tokio::io::{AsyncReadExt, BufReader, BufWriter};

use super::*;

#[tokio::test]
async fn reader() -> Result<()> {
let reader = "Hello World!".as_bytes();
Expand Down
6 changes: 3 additions & 3 deletions exclusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

[package]
name = "robotxt"
version = "0.6.0"
version = "0.6.1"
readme = "./README.md"

edition = { workspace = true }
license = { workspace = true }
authors = { workspace = true }

repository = "https://github.com/xwde/kit/exclusion"
homepage = "https://github.com/xwde/kit/exclusion"
repository = "https://github.com/spire-rs/kit/exclusion"
homepage = "https://github.com/spire-rs/kit/exclusion"
documentation = "https://docs.rs/robotxt"
categories = ["asynchronous", "web-programming"]
keywords = ["crawler", "scraper", "web", "framework"]
Expand Down
17 changes: 8 additions & 9 deletions exclusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ programming language with the support of `crawl-delay`, `sitemap` and universal

### Features

- `builder` to enable `robotxt::{RobotsBuilder, GroupBuilder}`. This feature is
**enabled by default**.
- `parser` to enable `robotxt::{Robots}`. This feature is **enabled by
- `parser` to enable `robotxt::{Robots}`. **Enabled by default**.
- `builder` to enable `robotxt::{RobotsBuilder, GroupBuilder}`. **Enabled by
default**.
- `optimal` to enable overlapping rule eviction and global rule optimizations
(this may result in longer parsing times but potentially faster matching).
- `serde` to enable a custom `serde::{Deserialize, Serialize}` implementation,
allowing for the caching of related rules.
- `optimal` to optimize overlapping and global rules, potentially improving
matching speed at the cost of longer parsing times.
- `serde` to enable `serde::{Deserialize, Serialize}` implementation, allowing
the caching of related rules.

### Examples

Expand All @@ -45,9 +44,9 @@ fn main() {
Disallow: *
Allow: /example/
Disallow: /example/nope.txt
"#.as_bytes();
"#;

let r = Robots::from_bytes(txt, "foobot");
let r = Robots::from_bytes(txt.as_bytes(), "foobot");
assert!(r.is_relative_allowed("/example/yeah.txt"));
assert!(!r.is_relative_allowed("/example/nope.txt"));
assert!(!r.is_relative_allowed("/invalid/path.txt"));
Expand Down
145 changes: 0 additions & 145 deletions exclusion/build/builder.rs

This file was deleted.

2 changes: 1 addition & 1 deletion exclusion/build/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashSet;
use std::fmt::{Display, Formatter};

use crate::build::format_comment;
use crate::normalize_path;
use crate::paths::normalize_path;

/// The single formatted `user-agent` group.
///
Expand Down
Loading
Loading