diff options
| author | dm <dm@work-pc> | 2022-02-17 10:31:19 +0800 |
|---|---|---|
| committer | Árni Dagur <arni@dagur.eu> | 2022-02-26 22:06:53 +0100 |
| commit | 3bbed50af769e2310c0bb366ab12a1d22c115082 (patch) | |
| tree | dc56cc993854a8670d3b5883f105cd36c80d9ef8 /src/lib.rs | |
| parent | 86ba5b7a5f65b6579813b86a4414270f896e6424 (diff) | |
fix: lint
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 12 |
1 files changed, 5 insertions, 7 deletions
| @@ -11,12 +11,12 @@ | |||
| 11 | deprecated | 11 | deprecated |
| 12 | )] | 12 | )] |
| 13 | 13 | ||
| 14 | use adblock::blocker::{BlockerError as RustBlockerError, Redirection}; | ||
| 15 | use adblock::blocker::BlockerResult as RustBlockerResult; | 14 | use adblock::blocker::BlockerResult as RustBlockerResult; |
| 15 | use adblock::blocker::{BlockerError as RustBlockerError, Redirection}; | ||
| 16 | use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; | 16 | use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; |
| 17 | use adblock::engine::Engine as RustEngine; | 17 | use adblock::engine::Engine as RustEngine; |
| 18 | use adblock::lists::{FilterFormat, ParseOptions}; | ||
| 19 | use adblock::lists::FilterSet as RustFilterSet; | 18 | use adblock::lists::FilterSet as RustFilterSet; |
| 19 | use adblock::lists::{FilterFormat, ParseOptions}; | ||
| 20 | use pyo3::class::PyObjectProtocol; | 20 | use pyo3::class::PyObjectProtocol; |
| 21 | use pyo3::create_exception; | 21 | use pyo3::create_exception; |
| 22 | use pyo3::exceptions::PyException; | 22 | use pyo3::exceptions::PyException; |
| @@ -24,16 +24,15 @@ use pyo3::prelude::*; | |||
| 24 | use pyo3::types::PyBytes; | 24 | use pyo3::types::PyBytes; |
| 25 | use pyo3::PyErr; | 25 | use pyo3::PyErr; |
| 26 | 26 | ||
| 27 | use adblock::resources::{ | ||
| 28 | AddResourceError as RustAddResourceError, MimeType, Resource, ResourceType, | ||
| 29 | }; | ||
| 27 | use std::collections::HashMap; | 30 | use std::collections::HashMap; |
| 28 | use std::collections::HashSet; | 31 | use std::collections::HashSet; |
| 29 | use std::error::Error; | 32 | use std::error::Error; |
| 30 | use std::fmt::{self, Display}; | 33 | use std::fmt::{self, Display}; |
| 31 | use std::fs; | 34 | use std::fs; |
| 32 | use std::io::{Read, Write}; | 35 | use std::io::{Read, Write}; |
| 33 | use adblock::resources::{ | ||
| 34 | AddResourceError as RustAddResourceError, MimeType, Resource, ResourceType, | ||
| 35 | }; | ||
| 36 | |||
| 37 | 36 | ||
| 38 | /// Brave's adblocking library in Python! | 37 | /// Brave's adblocking library in Python! |
| 39 | #[pymodule] | 38 | #[pymodule] |
| @@ -197,7 +196,6 @@ create_exception!(adblock, BadFilterAddUnsupported, BlockerException); | |||
| 197 | create_exception!(adblock, FilterExists, BlockerException); | 196 | create_exception!(adblock, FilterExists, BlockerException); |
| 198 | create_exception!(adblock, AddResourceError, BlockerException); | 197 | create_exception!(adblock, AddResourceError, BlockerException); |
| 199 | 198 | ||
| 200 | |||
| 201 | impl From<BlockerError> for PyErr { | 199 | impl From<BlockerError> for PyErr { |
| 202 | fn from(err: BlockerError) -> Self { | 200 | fn from(err: BlockerError) -> Self { |
| 203 | let msg = format!("{:?}", err); | 201 | let msg = format!("{:?}", err); |
