diff options
| author | Árni Dagur <agudmundsson@fc-md.umd.edu> | 2020-04-05 03:59:39 -0400 |
|---|---|---|
| committer | Árni Dagur <agudmundsson@fc-md.umd.edu> | 2020-04-05 03:59:39 -0400 |
| commit | 5b1284cbb56963315c6576b39c7e1329fc9954e8 (patch) | |
| tree | c4a28340752424cb6f4be5733c77e47d705d53ef | |
| parent | d697bf7ee74e0e3dc476c176a392269530ff6c74 (diff) | |
Bugfix: Allow overwriting existing file in 'serialize_to_file'
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | pyproject.toml | 2 | ||||
| -rw-r--r-- | src/lib.rs | 3 |
3 files changed, 4 insertions, 3 deletions
| @@ -1,7 +1,7 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "adblock" | 2 | name = "adblock" |
| 3 | publish = false | 3 | publish = false |
| 4 | version = "0.1.1" | 4 | version = "0.1.2" |
| 5 | authors = ["Árni Dagur <arni@dagur.eu"] | 5 | authors = ["Árni Dagur <arni@dagur.eu"] |
| 6 | edition = "2018" | 6 | edition = "2018" |
| 7 | 7 | ||
diff --git a/pyproject.toml b/pyproject.toml index b7e1d33..f629403 100644 --- a/pyproject.toml +++ b/pyproject.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [tool.poetry] | 1 | [tool.poetry] |
| 2 | name = "adblock" | 2 | name = "adblock" |
| 3 | version = "0.1.1" | 3 | version = "0.1.2" |
| 4 | description = "Brave's adblocking in Python" | 4 | description = "Brave's adblocking in Python" |
| 5 | authors = ["Árni Dagur <arni@dagur.eu>"] | 5 | authors = ["Árni Dagur <arni@dagur.eu>"] |
| 6 | license = "Apache-2.0" | 6 | license = "Apache-2.0" |
| @@ -199,7 +199,8 @@ impl Engine { | |||
| 199 | 199 | ||
| 200 | pub fn serialize_to_file(&mut self, file: &str) -> PyResult<()> { | 200 | pub fn serialize_to_file(&mut self, file: &str) -> PyResult<()> { |
| 201 | let mut fd = fs::OpenOptions::new() | 201 | let mut fd = fs::OpenOptions::new() |
| 202 | .create_new(true) | 202 | .create(true) |
| 203 | .truncate(true) | ||
| 203 | .write(true) | 204 | .write(true) |
| 204 | .open(file)?; | 205 | .open(file)?; |
| 205 | let data = self.serialize()?; | 206 | let data = self.serialize()?; |
