nushell/crates
Bob Hyman bc437da5c7
std dt datetime-diff: fix uninitialized field ref when borrowing (#10466)
fixes #10455 

@KAAtheWiseGit, I'm sorry, I didn't mean to block your first PR #10461,
didn't see you had submitted it till I got around to submitting this. If
you want to incoporate useful ideas from this PR into yours, I do not
mind deferring to you.


# Description
Changes made in `datetime-diff`:
* Initialize millisecond and microsecond fields in `$current`, to fix
the error when borrow needs to refer to them.
* Fix `borrow_nanoseconds` to borrow from seconds, not from (unused)
microseconds.
* Added error check to insist that first argument is >= second argument.
`datetime-diff` doesn't represent negative durations correctly (it tries
to borrow out of the year, resulting in negative year and positive all
other fields). We don't currently have a use case requiring negative
durations.
* Add comments so help is a bit clearer (I was surprised that the first
argument, named `$from` was actually supposed to be the *later*
datetime. The order of arguments is reasonable (reminiscent of <later>
<minus> <earlier>), so I just changed the param name to match its
purpose.

Changes made in `pretty-print-duration`:
* changed type of argument from `duration` to `record`. (it's not clear
why Nu was not complaining about this!)
* changed test for skipping a clause from `> 0` to `!= 0`. Even though
`datetime-diff` won't present a negative field in the record, user might
call `pretty-print-duration` with one, might as well handle it. (but I
think `hour:-2` will be rendered as `-2hr`, not `-2hrs`...).
* added help and an example.

# User-Facing Changes
none requiring code changes.

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
- 
- # After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-09-24 10:53:56 +02:00
..
nu_plugin_custom_values Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu_plugin_example Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu_plugin_formats Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu_plugin_gstat Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu_plugin_inc Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu_plugin_python remove vectorize_over_list from python plugin (#9905) 2023-08-03 16:46:48 +02:00
nu_plugin_query Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-cli Transient prompt (#10391) 2023-09-22 14:35:09 -05:00
nu-cmd-base Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-cmd-dataframe Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-cmd-extra Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-cmd-lang Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-color-config Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-command differentiating between --x and --x: bool (#10456) 2023-09-23 10:20:48 +02:00
nu-engine Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-explore Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-glob Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-json Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-parser show the whole path in "missing mod.nu" errors (#10416) 2023-09-23 16:30:03 +03:00
nu-path Fix tilde-expansion for multi-byte unicode chars (#10434) 2023-09-21 04:04:28 +12:00
nu-plugin Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-pretty-hex Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-protocol show the whole path in "missing mod.nu" errors (#10416) 2023-09-23 16:30:03 +03:00
nu-std std dt datetime-diff: fix uninitialized field ref when borrowing (#10466) 2023-09-24 10:53:56 +02:00
nu-system Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-table Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-term-grid Bump to 0.85.1 development version (#10431) 2023-09-20 18:38:42 +12:00
nu-test-support Simplify nu! test macros. (#10403) 2023-09-21 20:11:56 +02:00
nu-utils Transient prompt (#10391) 2023-09-22 14:35:09 -05:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.