From 8e31300db7d9baa2fd204e46bb5ee90360ffb012 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Tue, 30 Jan 2024 15:08:01 -0500 Subject: [PATCH] Bump MSRV back down to 1.70 --- Cargo.toml | 2 +- README.md | 2 +- src/dav/mod.rs | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 486cd1f..64e5323 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "dandidav" version = "0.1.0" edition = "2021" -rust-version = "1.74" +rust-version = "1.70" description = "WebDAV view to DANDI Archive" authors = ["John Thorvald Wodder II "] repository = "https://github.com/jwodder/dandidav" diff --git a/README.md b/README.md index b2a4e55..40c6844 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) [![CI Status](https://github.com/jwodder/dandidav/actions/workflows/test.yml/badge.svg)](https://github.com/jwodder/dandidav/actions/workflows/test.yml) [![codecov.io](https://codecov.io/gh/jwodder/dandidav/branch/main/graph/badge.svg)](https://codecov.io/gh/jwodder/dandidav) -[![Minimum Supported Rust Version](https://img.shields.io/badge/MSRV-1.74-orange)](https://www.rust-lang.org) +[![Minimum Supported Rust Version](https://img.shields.io/badge/MSRV-1.70-orange)](https://www.rust-lang.org) [![MIT License](https://img.shields.io/github/license/jwodder/dandidav.svg)](https://opensource.org/licenses/MIT) [GitHub](https://github.com/jwodder/dandidav) | [Issues](https://github.com/jwodder/dandidav/issues) diff --git a/src/dav/mod.rs b/src/dav/mod.rs index a618928..6ac25d9 100644 --- a/src/dav/mod.rs +++ b/src/dav/mod.rs @@ -49,7 +49,10 @@ impl DandiDav { req: Request, ) -> Result, DavError> { let uri_path = req.uri().path(); - let resp = match req.method() { + // Performing this assignment outside the `match` magically makes this + // compile on pre-1.74 Rusts: + let m = req.method(); + let resp = match m { &Method::GET if uri_path == "/.static/styles.css" => { // Don't add WebDAV headers return Ok(([(CONTENT_TYPE, CSS_CONTENT_TYPE)], STYLESHEET).into_response());