Rocket

A web framework for Rust. https://rocket.rs (mirror)
git clone git://git.thc420.xyz/Rocket
Log | Files | Refs | README

commit 7f2c9f426cd88b6e09022954570c448cab6403f7
parent b5b4c696f8af801817642218bccbe2c519c6b303
Author: Sergio Benitez <sb@sergio.bz>
Date:   Wed,  3 Jul 2019 21:23:57 -0700

Fix tests for Windows.

Diffstat:
Mcontrib/lib/tests/static_files.rs | 2+-
Mcore/http/src/ext.rs | 2+-
Mcore/lib/src/config/config.rs | 2--
Mexamples/static_files/static/rocket-icon.jpg | 0
Mexamples/todo/static/images/favicon.png | 0
5 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/contrib/lib/tests/static_files.rs b/contrib/lib/tests/static_files.rs @@ -44,7 +44,7 @@ mod static_tests { ]; fn assert_file(client: &Client, prefix: &str, path: &str, exists: bool) { - let full_path = format!("/{}", Path::new(prefix).join(path).display()); + let full_path = format!("/{}/{}", prefix, path); let mut response = client.get(full_path).dispatch(); if exists { assert_eq!(response.status(), Status::Ok); diff --git a/core/http/src/ext.rs b/core/http/src/ext.rs @@ -109,7 +109,7 @@ pub trait Normalize { impl<T: AsRef<Path>> Normalize for T { #[cfg(windows)] - fn normalized_str(&self) -> Cow<str> { + fn normalized_str(&self) -> Cow<'_, str> { self.as_ref().to_string_lossy().replace('\\', "/").into() } diff --git a/core/lib/src/config/config.rs b/core/lib/src/config/config.rs @@ -331,8 +331,6 @@ impl Config { /// /// # #[cfg(not(windows))] /// assert_eq!(config.root().unwrap(), Path::new("/var/my_app")); - /// # #[cfg(windows)] - /// assert_eq!(config.root().unwrap(), Path::new("C:\\var\\my_app")); /// ``` pub fn set_root<P: AsRef<Path>>(&mut self, path: P) { self.root_path = Some(path.as_ref().into()); diff --git a/examples/static_files/static/rocket-icon.jpg b/examples/static_files/static/rocket-icon.jpg Binary files differ. diff --git a/examples/todo/static/images/favicon.png b/examples/todo/static/images/favicon.png Binary files differ.