1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
// todo: implement #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] pub struct Uri { uri: String, } // todo impl Uri { pub fn new(uri: String) -> Uri { Uri { uri } } /// Returns the string representation of the URI. pub fn to_string(&self) -> &String { &self.uri } /// todo pub fn append_resource_path(&mut self, path: &str) { // todo: check if URI ends with '/', if not add '/' self.uri.push_str(&path.to_string()); } }