Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jendrikw committed Aug 1, 2024
1 parent d28a175 commit 5aa8530
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Easily remove tracking parameters and other nuisance from URLs with a simple API

```rust
use clearurls::UrlCleaner;
fn main() -> Result<(), Box<dyn std::error::Error>> {
fn main() -> Result<(), clearurls::Error> {
let cleaner = UrlCleaner::from_embedded_rules()?;
let res = cleaner.clear_url("https://example.com/test?utm_source=abc")?;
assert_eq!(res, "https://example.com/test");
Expand All @@ -23,7 +23,7 @@ There is a `std` feature (enabled by default) to include utility functions to re
but the core logic doesn't depend on that and the crate is perfectly usable without `std`.

## Acknowledgements
`data.minify.json` was downloaded from <https://github.com/ClearURLs/Rules>z
`data.minify.json` was downloaded from <https://github.com/ClearURLs/Rules>


## License
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//! # Example
//! ```
//! # use clearurls::UrlCleaner;
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! # fn main() -> Result<(), clearurls::Error> {
//! let cleaner = UrlCleaner::from_embedded_rules()?;
//! let res = cleaner.clear_url("https://example.com/test?utm_source=abc")?;
//! assert_eq!(res, "https://example.com/test");
Expand All @@ -52,7 +52,6 @@ extern crate std;
use alloc::borrow::Cow;
use core::fmt::{Display, Formatter};
use core::str::Utf8Error;
use std::fs::File;
use regex::Regex;
use url::ParseError;

Expand All @@ -77,7 +76,7 @@ impl UrlCleaner {
/// See [`Error`]
#[cfg(feature = "std")]
pub fn from_rules_path(path: &std::path::Path) -> Result<Self, Error> {
Self::from_rules_file(File::open(path)?)
Self::from_rules_file(std::fs::File::open(path)?)
}

/// Construct a [`UrlCleaner`] with rules from a [reader][std::io::Read], most often a [`File`]
Expand Down

0 comments on commit 5aa8530

Please sign in to comment.