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 @@ -26,7 +26,11 @@ pub struct Endpoint {
26
26
impl Endpoint {
27
27
/// Converts Endpoint to resource. Does not save it.
28
28
pub fn to_resource ( & self , store : & impl Storelike ) -> AtomicResult < Resource > {
29
- let subject = format ! ( "{}{}" , store. get_server_url( ) , self . path) ;
29
+ let subject = store
30
+ . get_server_url ( )
31
+ . clone ( )
32
+ . set_path ( & self . path )
33
+ . to_string ( ) ;
30
34
let mut resource = store. get_resource_new ( & subject) ;
31
35
resource. set_propval_string ( urls:: DESCRIPTION . into ( ) , & self . description , store) ?;
32
36
resource. set_propval_string ( urls:: SHORTNAME . into ( ) , & self . shortname , store) ?;
@@ -42,6 +46,14 @@ impl Endpoint {
42
46
}
43
47
}
44
48
49
+ impl std:: fmt:: Debug for Endpoint {
50
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
51
+ f. debug_struct ( "Endpoint" )
52
+ . field ( "path" , & self . path )
53
+ . finish ( )
54
+ }
55
+ }
56
+
45
57
pub fn default_endpoints ( ) -> Vec < Endpoint > {
46
58
vec ! [
47
59
plugins:: versioning:: version_endpoint( ) ,
You can’t perform that action at this time.
0 commit comments