Skip to content

Commit 7529bc5

Browse files
authored
Update to comply with legal review (#11)
1 parent a99eacc commit 7529bc5

File tree

12 files changed

+74
-23
lines changed

12 files changed

+74
-23
lines changed

.github/workflows/build-and-test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@v3
3333

34+
# no_global_oom_handling is currently broken in 1.69: https://github.com/rust-lang/rust/pull/110649
35+
# So use 1.68 until it gets fixed.
3436
- name: Update Rust toolchain
35-
run: rustup update
37+
run: rustup install 1.68
3638

37-
- name: Add the rust-src component
38-
run: rustup component add rust-src --toolchain stable-${{ matrix.target }}
39+
- name: Set 1.68 as the default
40+
run: rustup default 1.68
41+
42+
- name: Add required components
43+
run: rustup component add rust-src clippy rustfmt rust-docs --toolchain 1.68-${{ matrix.target }}
3944

4045
- name: Run build script
4146
shell: pwsh

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contributing
2+
3+
This project welcomes contributions and suggestions. Most contributions require you to
4+
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
5+
and actually do, grant us the rights to use your contribution. For details, visit
6+
https://cla.microsoft.com.
7+
8+
When you submit a pull request, a CLA-bot will automatically determine whether you need
9+
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
10+
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
11+
12+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
13+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
14+
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "fallible_vec"
33
description = "Fallible allocation functions for the Rust standard library's `Vec` type."
4-
version = "0.3.0"
4+
version = "0.3.1"
55
edition = "2021"
66
license-file = "LICENSE"
77
repository = "https://github.com/microsoft/rust_fallible_vec"

LICENSE

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
1+
Copyright (c) Microsoft Corporation.
22

3-
Copyright (c) Microsoft Corporation.
3+
MIT License
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1414

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ in its CI.
6262

6363
Comparing `fallible_vec` to [`fallible_collections`](https://crates.io/crates/fallible_collections):
6464

65-
| | `fallible_vec` v0.1.0 | `fallible_collections` v0.4.7 |
65+
| | `fallible_vec` v0.3.1 | `fallible_collections` v0.4.7 |
6666
|-------------------------------------------|:---------------------:|:-----------------------------:|
6767
| Supports `no_std` | X | X |
6868
| Supports `#[cfg(no_global_oom_handling)]` | X | |

build.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ function Invoke-WithEnvironment([System.Collections.IDictionary] $Environment, [
4747
}
4848
}
4949

50+
# Verify that all sources files have the copyright header.
51+
[string[]] $copyrightHeader = @("// Copyright (c) Microsoft Corporation.", "// Licensed under the MIT license.")
52+
[bool] $hadMissingCopyright = $false
53+
foreach ($file in (Get-ChildItem -Path (Join-Path $PSScriptRoot 'src') -Filter '*.rs' -Recurse)) {
54+
$contents = Get-Content -Path $file -TotalCount $copyrightHeader.Length
55+
if ($null -ne (Compare-Object -ReferenceObject $copyrightHeader -DifferenceObject $contents)) {
56+
$hadMissingCopyright = $true
57+
$fileName = $file.FullName
58+
Write-Error "'$fileName' is missing the copyright header." -ErrorAction Continue
59+
}
60+
}
61+
if ($hadMissingCopyright) {
62+
$mergedCopyrightHeader = $copyrightHeader | Join-String -Separator "`n"
63+
Write-Error "One or more files was missing the copyright header. To fix this, add the copyright header to any non-compliant files:`n$mergedCopyrightHeader"
64+
exit 1
65+
}
66+
5067
Invoke-WithEnvironment `
5168
-Environment @{
5269
# Enable unstable features on stable toolchain.

src/collect.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
use crate::FallibleVec;
25
use crate::TryReserveError;
36
use alloc::vec::Vec;

src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
use core::alloc::Layout;
25

36
#[allow(dead_code)]

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
//! Fallible allocation functions for the Rust standard library's [`alloc::vec::Vec`]
25
//! type.
36
//!

0 commit comments

Comments
 (0)