From b96a1d3dbea2d8092d03ae32ddbe1381b634ebc3 Mon Sep 17 00:00:00 2001 From: bridiver <34129+bridiver@users.noreply.github.com> Date: Fri, 28 Feb 2025 07:23:36 -0700 Subject: [PATCH] presubmit --- third_party/rust/url/v2/BUILD.gn | 9 +++------ third_party/rust/url/v2/crate/Cargo.toml | 2 +- third_party/rust/url/v2/crate/DEPS | 3 +++ third_party/rust/url/v2/crate/parse.cc | 5 +++++ third_party/rust/url/v2/crate/parse.h | 12 +++++++++--- third_party/rust/url/v2/crate/src/lib.rs | 13 +++++++++++++ 6 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 third_party/rust/url/v2/crate/DEPS diff --git a/third_party/rust/url/v2/BUILD.gn b/third_party/rust/url/v2/BUILD.gn index c47cdbd5c62e..1e804c58df64 100644 --- a/third_party/rust/url/v2/BUILD.gn +++ b/third_party/rust/url/v2/BUILD.gn @@ -22,8 +22,8 @@ static_library("parser") { ] deps = [ - "//url", ":lib_internal", + "//url", ] } @@ -31,11 +31,8 @@ cargo_crate("lib_internal") { crate_name = "url" epoch = "2" crate_type = "rlib" - crate_root = - "crate/src/lib.rs" - sources = [ - "crate/src/lib.rs" - ] + crate_root = "crate/src/lib.rs" + sources = [ "crate/src/lib.rs" ] inputs = [] cxx_bindings = [ "crate/src/lib.rs" ] diff --git a/third_party/rust/url/v2/crate/Cargo.toml b/third_party/rust/url/v2/crate/Cargo.toml index a0a9ffcaf62d..f8cb7f81fc5c 100644 --- a/third_party/rust/url/v2/crate/Cargo.toml +++ b/third_party/rust/url/v2/crate/Cargo.toml @@ -3,7 +3,7 @@ edition = "2018" rust-version = "1.51" name = "url" version = "2.3.1" -authors = ["The rust-url developers"] +authors = ["The rust-url developers", "Brave developers"] include = [ "src/**/*", "LICENSE-*", diff --git a/third_party/rust/url/v2/crate/DEPS b/third_party/rust/url/v2/crate/DEPS new file mode 100644 index 000000000000..6a25be5cafad --- /dev/null +++ b/third_party/rust/url/v2/crate/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+third_party/rust/cxx/v1/cxx.h" +] diff --git a/third_party/rust/url/v2/crate/parse.cc b/third_party/rust/url/v2/crate/parse.cc index 554111df7896..1af4454563d5 100644 --- a/third_party/rust/url/v2/crate/parse.cc +++ b/third_party/rust/url/v2/crate/parse.cc @@ -1,3 +1,8 @@ +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + #include "brave/third_party/rust/url/v2/crate/parse.h" #include diff --git a/third_party/rust/url/v2/crate/parse.h b/third_party/rust/url/v2/crate/parse.h index 355ae5d910b4..36ea8850142b 100644 --- a/third_party/rust/url/v2/crate/parse.h +++ b/third_party/rust/url/v2/crate/parse.h @@ -1,11 +1,17 @@ -#pragma once +/* Copyright (c) 2025 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#ifndef THIRD_PARTY_RUST_URL_V2_CRATE_PARSE_H_ +#define THIRD_PARTY_RUST_URL_V2_CRATE_PARSE_H_ #include "third_party/rust/cxx/v1/cxx.h" namespace cxx_url { - struct ParseResult; - ParseResult ParseURL(rust::Str host); ParseResult Resolve(const ParseResult& base, rust::Str relative); } // namespace url + +#endif // THIRD_PARTY_RUST_URL_V2_CRATE_PARSE_H_ diff --git a/third_party/rust/url/v2/crate/src/lib.rs b/third_party/rust/url/v2/crate/src/lib.rs index 17f9456d07ab..8d1d0e722789 100644 --- a/third_party/rust/url/v2/crate/src/lib.rs +++ b/third_party/rust/url/v2/crate/src/lib.rs @@ -1,3 +1,16 @@ +// Copyright 2013-2015 The rust-url developers. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Copyright (c) 2025 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + use std::cmp; use std::fmt::{self, Write}; use std::hash;