File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,11 @@ pub struct PostEndpoint {
56
56
impl Endpoint {
57
57
/// Converts Endpoint to resource. Does not save it.
58
58
pub fn to_resource ( & self , store : & impl Storelike ) -> AtomicResult < Resource > {
59
- let subject = format ! ( "{}{}" , store. get_server_url( ) , self . path) ;
59
+ let subject = store
60
+ . get_server_url ( )
61
+ . clone ( )
62
+ . set_path ( & self . path )
63
+ . to_string ( ) ;
60
64
let mut resource = store. get_resource_new ( & subject) ;
61
65
resource. set_propval_string ( urls:: DESCRIPTION . into ( ) , & self . description , store) ?;
62
66
resource. set_propval_string ( urls:: SHORTNAME . into ( ) , & self . shortname , store) ?;
@@ -72,6 +76,14 @@ impl Endpoint {
72
76
}
73
77
}
74
78
79
+ impl std:: fmt:: Debug for Endpoint {
80
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
81
+ f. debug_struct ( "Endpoint" )
82
+ . field ( "path" , & self . path )
83
+ . finish ( )
84
+ }
85
+ }
86
+
75
87
pub fn default_endpoints ( ) -> Vec < Endpoint > {
76
88
vec ! [
77
89
plugins:: versioning:: version_endpoint( ) ,
You can’t perform that action at this time.
0 commit comments