@@ -41,7 +41,7 @@ struct url : url_base {
4141 url (url &&u) noexcept = default ;
4242 url &operator =(url &&u) noexcept = default ;
4343 url &operator =(const url &u) = default ;
44- ~url () = default ;
44+ ~url () override = default ;
4545
4646 /* *
4747 * @private
@@ -102,7 +102,7 @@ struct url : url_base {
102102 /* *
103103 * Returns a JSON string representation of this URL.
104104 */
105- std::string to_string () const override ;
105+ [[nodiscard]] std::string to_string () const override ;
106106
107107 /* *
108108 * @see https://url.spec.whatwg.org/#dom-url-href
@@ -149,15 +149,15 @@ struct url : url_base {
149149 * @return a newly allocated string.
150150 * @see https://url.spec.whatwg.org/#dom-url-pathname
151151 */
152- [[nodiscard]] const std::string_view get_pathname () const noexcept ;
152+ [[nodiscard]] std::string_view get_pathname () const noexcept ;
153153
154154 /* *
155155 * Compute the pathname length in bytes without instantiating a view or a
156156 * string.
157157 * @return size of the pathname in bytes
158158 * @see https://url.spec.whatwg.org/#dom-url-pathname
159159 */
160- ada_really_inline size_t get_pathname_length () const noexcept ;
160+ [[nodiscard]] ada_really_inline size_t get_pathname_length () const noexcept ;
161161
162162 /* *
163163 * Return U+003F (?), followed by this's URL's query.
@@ -177,60 +177,60 @@ struct url : url_base {
177177 * @return Returns true on successful operation.
178178 * @see https://url.spec.whatwg.org/#dom-url-username
179179 */
180- bool set_username (const std::string_view input);
180+ bool set_username (std::string_view input);
181181
182182 /* *
183183 * @return Returns true on success.
184184 * @see https://url.spec.whatwg.org/#dom-url-password
185185 */
186- bool set_password (const std::string_view input);
186+ bool set_password (std::string_view input);
187187
188188 /* *
189189 * @return Returns true on success.
190190 * @see https://url.spec.whatwg.org/#dom-url-port
191191 */
192- bool set_port (const std::string_view input);
192+ bool set_port (std::string_view input);
193193
194194 /* *
195195 * This function always succeeds.
196196 * @see https://url.spec.whatwg.org/#dom-url-hash
197197 */
198- void set_hash (const std::string_view input);
198+ void set_hash (std::string_view input);
199199
200200 /* *
201201 * This function always succeeds.
202202 * @see https://url.spec.whatwg.org/#dom-url-search
203203 */
204- void set_search (const std::string_view input);
204+ void set_search (std::string_view input);
205205
206206 /* *
207207 * @return Returns true on success.
208208 * @see https://url.spec.whatwg.org/#dom-url-search
209209 */
210- bool set_pathname (const std::string_view input);
210+ bool set_pathname (std::string_view input);
211211
212212 /* *
213213 * @return Returns true on success.
214214 * @see https://url.spec.whatwg.org/#dom-url-host
215215 */
216- bool set_host (const std::string_view input);
216+ bool set_host (std::string_view input);
217217
218218 /* *
219219 * @return Returns true on success.
220220 * @see https://url.spec.whatwg.org/#dom-url-hostname
221221 */
222- bool set_hostname (const std::string_view input);
222+ bool set_hostname (std::string_view input);
223223
224224 /* *
225225 * @return Returns true on success.
226226 * @see https://url.spec.whatwg.org/#dom-url-protocol
227227 */
228- bool set_protocol (const std::string_view input);
228+ bool set_protocol (std::string_view input);
229229
230230 /* *
231231 * @see https://url.spec.whatwg.org/#dom-url-href
232232 */
233- bool set_href (const std::string_view input);
233+ bool set_href (std::string_view input);
234234
235235 /* *
236236 * The password getter steps are to return this's URL's password.
@@ -301,9 +301,9 @@ struct url : url_base {
301301 inline void update_base_search (std::string_view input,
302302 const uint8_t query_percent_encode_set[]);
303303 inline void update_base_search (std::optional<std::string> input);
304- inline void update_base_pathname (const std::string_view input);
305- inline void update_base_username (const std::string_view input);
306- inline void update_base_password (const std::string_view input);
304+ inline void update_base_pathname (std::string_view input);
305+ inline void update_base_username (std::string_view input);
306+ inline void update_base_password (std::string_view input);
307307 inline void update_base_port (std::optional<uint16_t > input);
308308
309309 /* *
@@ -349,9 +349,12 @@ struct url : url_base {
349349 */
350350 [[nodiscard]] inline bool cannot_have_credentials_or_port () const ;
351351
352- ada_really_inline size_t
353- parse_port (std::string_view view,
354- bool check_trailing_content = false ) noexcept override ;
352+ ada_really_inline size_t parse_port (
353+ std::string_view view, bool check_trailing_content) noexcept override ;
354+
355+ ada_really_inline size_t parse_port (std::string_view view) noexcept override {
356+ return this ->parse_port (view, false );
357+ }
355358
356359 /* *
357360 * Take the scheme from another URL. The scheme string is copied from the
@@ -370,8 +373,7 @@ struct url : url_base {
370373 [[nodiscard]] ada_really_inline bool parse_host (std::string_view input);
371374
372375 template <bool has_state_override = false >
373- [[nodiscard]] ada_really_inline bool parse_scheme (
374- const std::string_view input);
376+ [[nodiscard]] ada_really_inline bool parse_scheme (std::string_view input);
375377
376378 inline void clear_pathname () override ;
377379 inline void clear_search () override ;
@@ -387,7 +389,7 @@ struct url : url_base {
387389 *
388390 * @see https://url.spec.whatwg.org/
389391 */
390- ada_really_inline void parse_path (const std::string_view input);
392+ ada_really_inline void parse_path (std::string_view input);
391393
392394 /* *
393395 * Set the scheme for this URL. The provided scheme should be a valid
0 commit comments