aboutsummaryrefslogtreecommitdiff
path: root/src/http
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-11-16 10:28:21 -0800
committerZeyla Hellyer <[email protected]>2017-11-16 10:28:40 -0800
commit7a5aa3c57951ee5c7267fabf38f2729b06629b34 (patch)
treea6ee66602e4eee134b9c03ded02d96d433427d61 /src/http
parentFix doc-tests (diff)
downloadserenity-7a5aa3c57951ee5c7267fabf38f2729b06629b34.tar.xz
serenity-7a5aa3c57951ee5c7267fabf38f2729b06629b34.zip
impl From<&Path> for http::AttachmentType
Diffstat (limited to 'src/http')
-rw-r--r--src/http/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/http/mod.rs b/src/http/mod.rs
index 9e8cba4..d79f7fd 100644
--- a/src/http/mod.rs
+++ b/src/http/mod.rs
@@ -1893,6 +1893,12 @@ impl<'a> From<&'a str> for AttachmentType<'a> {
fn from(s: &'a str) -> AttachmentType { AttachmentType::Path(Path::new(s)) }
}
+impl<'a> From<&'a Path> for AttachmentType<'a> {
+ fn from(path: &'a Path) -> AttachmentType {
+ AttachmentType::Path(path)
+ }
+}
+
impl<'a> From<&'a PathBuf> for AttachmentType<'a> {
fn from(pathbuf: &'a PathBuf) -> AttachmentType { AttachmentType::Path(pathbuf.as_path()) }
}