summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ca763bc..5fba7dd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,12 +11,12 @@
11 deprecated 11 deprecated
12)] 12)]
13 13
14use adblock::blocker::{BlockerError as RustBlockerError, Redirection};
15use adblock::blocker::BlockerResult as RustBlockerResult; 14use adblock::blocker::BlockerResult as RustBlockerResult;
15use adblock::blocker::{BlockerError as RustBlockerError, Redirection};
16use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources; 16use adblock::cosmetic_filter_cache::UrlSpecificResources as RustUrlSpecificResources;
17use adblock::engine::Engine as RustEngine; 17use adblock::engine::Engine as RustEngine;
18use adblock::lists::{FilterFormat, ParseOptions};
19use adblock::lists::FilterSet as RustFilterSet; 18use adblock::lists::FilterSet as RustFilterSet;
19use adblock::lists::{FilterFormat, ParseOptions};
20use pyo3::class::PyObjectProtocol; 20use pyo3::class::PyObjectProtocol;
21use pyo3::create_exception; 21use pyo3::create_exception;
22use pyo3::exceptions::PyException; 22use pyo3::exceptions::PyException;
@@ -24,16 +24,15 @@ use pyo3::prelude::*;
24use pyo3::types::PyBytes; 24use pyo3::types::PyBytes;
25use pyo3::PyErr; 25use pyo3::PyErr;
26 26
27use adblock::resources::{
28 AddResourceError as RustAddResourceError, MimeType, Resource, ResourceType,
29};
27use std::collections::HashMap; 30use std::collections::HashMap;
28use std::collections::HashSet; 31use std::collections::HashSet;
29use std::error::Error; 32use std::error::Error;
30use std::fmt::{self, Display}; 33use std::fmt::{self, Display};
31use std::fs; 34use std::fs;
32use std::io::{Read, Write}; 35use std::io::{Read, Write};
33use 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);
197create_exception!(adblock, FilterExists, BlockerException); 196create_exception!(adblock, FilterExists, BlockerException);
198create_exception!(adblock, AddResourceError, BlockerException); 197create_exception!(adblock, AddResourceError, BlockerException);
199 198
200
201impl From<BlockerError> for PyErr { 199impl 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);