diff options
Diffstat (limited to 'src/api/log.rs')
| -rw-r--r-- | src/api/log.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/api/log.rs b/src/api/log.rs index 4881b38..5d44926 100644 --- a/src/api/log.rs +++ b/src/api/log.rs @@ -18,7 +18,12 @@ pub(crate) async fn get_log_filter() -> Result<String, StatusCode> { /// 400 (with the reason) if the body doesn't parse, and the old filter stays. pub(crate) async fn put_log_filter(body: Bytes) -> Result<String, (StatusCode, String)> { let directives = std::str::from_utf8(&body) - .map_err(|_| (StatusCode::BAD_REQUEST, "The filter must be UTF-8\n".to_owned()))? + .map_err(|_| { + ( + StatusCode::BAD_REQUEST, + "The filter must be UTF-8\n".to_owned(), + ) + })? .trim(); let applied = logging::set_filter(directives) .map_err(|error| (StatusCode::BAD_REQUEST, format!("{error:#}\n")))?; |
