Skip to content

Commit

Permalink
resp.text_markdown, resp.text_plain: set default width=100
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 committed Jul 29, 2024
1 parent 5e577d6 commit a08d22c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,15 @@ impl Response {
#[getter]
fn text_markdown(&mut self, py: Python) -> PyResult<String> {
let raw_bytes = self.content.bind(py).as_bytes();
let text = py.allow_threads(|| from_read(raw_bytes, usize::MAX));
let text = py.allow_threads(|| from_read(raw_bytes, 100));
Ok(text)
}

#[getter]
fn text_plain(&mut self, py: Python) -> PyResult<String> {
let raw_bytes = self.content.bind(py).as_bytes();
let text = py.allow_threads(|| {
from_read_with_decorator(raw_bytes, usize::MAX, TrivialDecorator::new())
});
let text =
py.allow_threads(|| from_read_with_decorator(raw_bytes, 100, TrivialDecorator::new()));
Ok(text)
}
}

0 comments on commit a08d22c

Please sign in to comment.