about summary refs log tree commit diff
path: root/src/indieauth/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/indieauth/backend')
-rw-r--r--src/indieauth/backend/fs.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/indieauth/backend/fs.rs b/src/indieauth/backend/fs.rs
index 80c3703..5e97ae5 100644
--- a/src/indieauth/backend/fs.rs
+++ b/src/indieauth/backend/fs.rs
@@ -20,12 +20,6 @@ pub struct FileBackend {
 }
 
 impl FileBackend {
-    pub fn new<T: Into<PathBuf>>(path: T) -> Self {
-        Self {
-            path: path.into()
-        }
-    }
-
     /// Sanitize a filename, leaving only alphanumeric characters.
     ///
     /// Doesn't allocate a new string unless non-alphanumeric
@@ -193,6 +187,12 @@ impl FileBackend {
 
 #[async_trait]
 impl AuthBackend for FileBackend {
+    async fn new(path: &'_ url::Url) -> Result<Self> {
+        Ok(Self {
+            path: std::path::PathBuf::from(path.path())
+        })
+    }
+
     // Authorization code management.
     async fn create_code(&self, data: AuthorizationRequest) -> Result<String> {
         self.serialize_to_file("codes", None, CODE_LENGTH, data).await