aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-units
Commit message (Collapse)AuthorAgeFilesLines
* Bump patchlevel (not dependents) on crates with trivial changesNick Mathewson2023-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: ``` tor-basic-utils caret fs-mistrust safelog retry-error tor-events tor-units tor-geoip tor-rtcompat tor-rpcbase tor-protover tor-socksproto tor-checkable tor-congestion tor-persist tor-circmgr arti-rpcserver arti-config arti-hyper arti-bench arti-testing tor-consdiff ```
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Bump patchlevel versions of crates with trivial changesNick Mathewson2023-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have had trivial changes only: typically, changes to documentation or to clippy warnings. There's no good reason to update which version of them other crates depend on, so we only bump _their_ patchlevels. ``` tor-async-utils caret safelog tor-events tor-units tor-rtcompat tor-rpcbase tor-llcrypto tor-protover tor-bytes tor-hscrypto tor-socksproto tor-cert tor-cell tor-consdiff tor-congestion arti-rpcserver arti-testing arti-bench arti-config arti-hyper ```
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* Bump versions on crates with nonfunctional changesNick Mathewson2023-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates have had nonfunctional changes only, mostly due to !1271, or ac90cb7500f2f108, or documentation changes: crates that depend on them do not require a version bump. ``` arti-bench arti-config arti-hyper arti-testing caret fs-mistrust retry-error tor-async-utils tor-basic-utils tor-chanmgr tor-checkable tor-congestion tor-consdiff tor-events tor-guardmgr tor-persist tor-protover tor-ptmgr tor-rtcompat tor-rtmock tor-units ```
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Bump crate versions in preparation for v1.1.5 release.Nick Mathewson2023-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generated with the following commands: ``` cargo set-version --bump minor -p tor-cell cargo set-version --bump minor -p tor-linkspec cargo set-version --bump minor -p tor-proto cargo set-version --bump minor -p tor-netdoc cargo set-version --bump minor -p tor-circmgr cargo set-version --bump patch -p tor-cert cargo set-version --bump patch -p tor-basic-utils cargo set-version --bump patch -p tor-rpcbase cargo set-version --bump patch -p tor-llcrypto cargo set-version --bump patch -p tor-hscrypto cargo set-version --bump patch -p tor-checkable cargo set-version --bump patch -p tor-async-utils cargo set-version --bump patch -p caret cargo set-version --bump patch -p fs-mistrust cargo set-version --bump patch -p safelog cargo set-version --bump patch -p retry-error cargo set-version --bump patch -p tor-error cargo set-version --bump patch -p tor-config cargo set-version --bump patch -p tor-events cargo set-version --bump patch -p tor-units cargo set-version --bump patch -p tor-rtcompat cargo set-version --bump patch -p tor-rtmock cargo set-version --bump patch -p tor-protover cargo set-version --bump patch -p tor-bytes cargo set-version --bump patch -p tor-socksproto cargo set-version --bump patch -p tor-consdiff cargo set-version --bump patch -p tor-netdir cargo set-version --bump patch -p tor-congestion cargo set-version --bump patch -p tor-persist cargo set-version --bump patch -p tor-chanmgr cargo set-version --bump patch -p tor-ptmgr cargo set-version --bump patch -p tor-guardmgr cargo set-version --bump patch -p tor-dirclient cargo set-version --bump patch -p tor-dirmgr cargo set-version --bump patch -p tor-hsclient cargo set-version --bump patch -p tor-hsservice cargo set-version --bump patch -p arti-client cargo set-version --bump patch -p arti-rpcserver cargo set-version --bump patch -p arti-config cargo set-version --bump patch -p arti-hyper cargo set-version --bump patch -p arti cargo set-version --bump patch -p arti-bench cargo set-version --bump patch -p arti-testing ```
* Run fixup-features --no-annotate for initial Cargo.toml fixes.Nick Mathewson2023-05-151-0/+3
| | | | | | | | | This does the following: - Gives every crate a `full`. - Cause every `full` to depend on `full` from the lower-level crates. - Makes every feature listed _directly_ in `experimental` depend on `__is_experimental`.
* Increment crate versions.Nick Mathewson2023-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the errorkind bumps, we're calling this a breaking change in everything lower-level than `arti`. Generated with: ``` cargo set-version -p tor-basic-utils --bump minor cargo set-version -p tor-async-utils --bump minor cargo set-version -p caret --bump minor cargo set-version -p fs-mistrust --bump minor cargo set-version -p safelog --bump minor cargo set-version -p retry-error --bump minor cargo set-version -p tor-error --bump minor cargo set-version -p tor-config --bump minor cargo set-version -p tor-events --bump minor cargo set-version -p tor-units --bump minor cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-rtmock --bump minor cargo set-version -p tor-rpcbase --bump minor cargo set-version -p tor-llcrypto --bump minor cargo set-version -p tor-protover --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-hscrypto --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-checkable --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p tor-consdiff --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-congestion --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-ptmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p tor-hsclient --bump minor cargo set-version -p tor-hsservice --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti-rpcserver --bump minor cargo set-version -p arti-config --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti --bump patch cargo set-version -p arti-bench --bump patch cargo set-version -p arti-testing --bump patch ```
* Increment MSRV to 1.65 in every crate.Nick Mathewson2023-04-111-1/+1
|
* Remove semver.md files now that 1.1.2 is out.Nick Mathewson2023-02-281-2/+0
|
* Bump tor-units version for breaking change.Nick Mathewson2023-02-281-1/+1
| | | | | | | | (The breaking change was removing `as_days()` from IntegerMinutes.) We are _not_ calling this a downstream-api breaking change, per discussion at https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1012?commit_id=bb2ab7c2a3e0994bb438188511688b5b039cae29#note_2876819
* tor-units: Fix IntegerMinutes accessor (omg)Ian Jackson2023-02-092-1/+3
|
* Remove semver.md files now that 1.1.1 is tagged.Nick Mathewson2023-02-011-1/+0
|
* Bump the patch version of every crate that had API additionsNick Mathewson2023-02-011-1/+1
| | | | | | These crates had API or behavior changes that may affect downstream crates. Fortunately, they're all version 0.x, and don't need minor bumps for this.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* tor-units: Add an IntegerMinutes.Nick Mathewson2023-01-112-0/+87
|
* doc: consistent summary line for the READMEsEmil Engler2022-12-201-1/+1
| | | | | This commit introduces a consistency to the summary line of all README.md files in each and every crate.
* Bump the minor version of every crate.Nick Mathewson2022-11-301-1/+1
| | | | | We made this job easy this time around: by incrementing our MSRV, we have forced ourselves to do at least a minor bump everywhere.
* bump rust-version to 1.60 in every crate.Nick Mathewson2022-11-101-1/+1
|
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Require derive_more 0.99.3Ian Jackson2022-11-031-1/+1
| | | | | | | | 0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114 which makes the Deref derive for bridgedesc::StateGuard not work and therefore breaks minimal-versions CI. It seems simpler to require the newer version everywhere.
* Fix some rustdoc errors.Nick Mathewson2022-10-131-6/+6
| | | | | | In addition to the usual "You named that method wrong!" errors, we have a new rustdoc error that complains about bogus "HTML tags" that are actually unquoted usage of types like `Result<Foo>`.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-16/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Update patch-versions on crates without API changes.Nick Mathewson2022-09-011-1/+1
| | | | | | | Since our last round of releases, these crates have had either trivial changes, or changes that did not affect their APIs. Therefore we are bumping their versions, but not changing which versions of them other crates depend on.
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-242-0/+4
|
* Bump crate and dependency versions.Nick Mathewson2022-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were done with the following commands: ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-error --bump patch cargo set-version -p tor-config --bump patch cargo set-version -p tor-units --bump patch cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-llcrypto --bump patch cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump patch cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump patch cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump patch cargo set-version -p tor-dirclient --bump patch cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump patch cargo set-version -p arti --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor ```
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Merge branch 'error_cleanup' into 'main'Nick Mathewson2022-06-221-2/+2
|\ | | | | | | | | Error cleanup, part 1 See merge request tpo/core/arti!601
| * Style fixes to tor-units errors.Nick Mathewson2022-06-221-2/+2
| |
* | tor-units: IntegerTimeUnit: Provide try_mapIan Jackson2022-06-211-0/+50
| | | | | | | | | | | | | | | | | | | | | | This lets a caller map the inner value, eg to convert the type. I don't provide `map` as well as `try_map` now, since I don't need it; we could add it later if it is desirable (although try_map can always be used instead). I was hoping to provide a `TryFrom` instead, but that necesasrily overlaps with the std conversion impl from IntegerMilliseconds<T> to IntegerMilliseconds<U> where T == U.
* | tor-units: IntegerTimeUnit: Relax condition on TIan Jackson2022-06-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | It is semantically quite meaningful for these to contain something that isn't `TryInto<u64>`. (Of course the `Duration` conversion won't work without that.) Indeed, this condition was only applied to two out of the three types. Prompted by being near this code, but not actually necessary for anything I'm doing here.
* | tor-units: IntegerTimeUnit: Provide as_time_unit deconstructorIan Jackson2022-06-211-0/+24
|/ | | | We're going to need this to use this in the padding timer parameters.
* lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | From running add_warning, with manual picking of the right hunks/lines.
* lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
| | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* Lexically sort Cargo.toml dependenciesOrhun Parmaksız2022-05-281-1/+0
| | | | | | Utilize cargo-sort: https://github.com/DevinR528/cargo-sort Signed-off-by: Orhun Parmaksız <[email protected]>
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-1/+1
| | | | * Except for safelog and fs-mistrust, which are new.
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-2/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-3/+3
| | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-1/+1
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Merge branch 'clippy-allow-arc-clone' into 'main'Nick Mathewson2022-03-011-1/+0
|\ | | | | | | | | Disable clippy::clone_on_ref_ptr See merge request tpo/core/arti!352
| * Disable clippy::clone_on_ref_ptrIan Jackson2022-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lint is IMO inherently ill-conceived. I have looked for the reasons why this might be thought to be a good idea and there were basically two (and they are sort of contradictory): I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact that only the pointer is being cloned, not the underlying data." This is the wording from https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr It is a bit terse; we are left to infer why it is a bad idea to obscure this fact. It seems to me that if it is bad to obscure some fact, that must be because the fact is a hazard. But why would it be a hazard to not copy the underlying data ? In other languages, faliing to copy the underlying data is a serious correctness hazard. There is a whose class of bugs where things were not copied, and then mutated and/or reused in multiple places in ways that were not what the programmer intended. In my experience, this is a very common bug when writing Python and Javascript. I'm told it's common in golang too. But in Rust this bug is much much harder to write. The data inside an Arc is immutable. To have this bug you'd have use interior mutability - ie mess around with Mutex or RefCell. That provides a good barrier to these kind of accidents. II. "The reason for writing Rc::clone and Arc::clone [is] to make it clear that only the pointer is being cloned, as opposed to the underlying data. The former is always fast, while the latter can be very expensive depending on what is being cloned." This is the reasoning found here https://github.com/rust-lang/rust-clippy/issues/2048 This is saying that *not* using Arc::clone is hazardous. Specifically, that a deep clone is a performance hazard. But for this argument, the lint is precisely backwards. It's linting the "good" case and asking for it to be written in a more explicit way; while the supposedly bad case can be written conveniently. Also, many objects (in our codebase, and in all the libraries we use) that are Clone are in fact simply handles. They contain Arc(s) (or similar) and are cheap to clone. Indeed, that is the usual case. It does not make sense to distinguish in the syntax we use to clone such a handle, whether the handle is a transparent Arc, or an opaque struct containing one or more other handles. Forcing Arc::clone to be written as such makes for code churn when a type is changed from Arc<Something> to Something: Clone, or vice versa.
* | Bump all crates to 0.1.0arti-v0.1.0Nick Mathewson2022-03-011-1/+1
|/
* Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | Closes #338.
* Add editorconfig to force some rules (Final Newline)Daniel Schischkin2022-02-031-1/+1
|
* Bump all crate versions to 0.0.3.Nick Mathewson2022-01-111-1/+1
|