Update all dependencies #13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/all"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.0.60
->1.0.66
4.0.6
->4.0.16
0.5.13
->0.5.17
0.5.1
->0.5.17
3
->4
0.11.1
->0.11.3
14-alpine
->15-alpine
1.0.136
->1.0.147
1.0.68
->1.0.87
1.0.81
->1.0.87
0.5
->0.6
0.2
->0.3
1.20.1
->1.21.2
0.1.36
->0.1.37
0.3.15
->0.3.16
1.1.2
->1.2.2
0.15
->0.16
Release Notes
dtolnay/anyhow
v1.0.66
Compare Source
context
call (#279)v1.0.65
Compare Source
impl Provider for anyhow::Error
v1.0.64
Compare Source
#[source] anyhow::Error
with thiserror crate (#231)v1.0.63
Compare Source
v1.0.62
Compare Source
cargo
invocations with IDE builds (#261)v1.0.61
Compare Source
async-graphql/async-graphql
v4.0.16
CustomValidator<T>
forF: Fn(&T) -> Result<(), E: Into<String>>
validator
attribute toInputObject
macro #1072v4.0.15
SchemaBuilder::disable_suggestions
method to disable field suggestions. #1101v4.0.14
v4.0.13
bson-uuid
feature #1032no_cache
forcache_control
attribute #1051SDLExportOptions::include_specified_by
method to enablespecifiedBy
directive #1065v4.0.12
1.59.0
@specifiedBy
directive in SDL export #1041v4.0.11
override
directive on fields #1029@tag
support #1038v4.0.10
request.data(X)
being lost in the resolver #1018@shareable
directive support #1025@inaccessible
directive support #1026v4.0.9
on_connection_init
takesFnOnce
instead ofFn
#1022v4.0.8
v4.0.7
64
.tokio-rs/axum
v0.5.17
: axum - v0.5.17Compare Source
#[track_caller]
so the errormessage points to where the user added the invalid router, rather than
somewhere internally in axum (#1248)
Multipart
extractor work withRequestBodyLimit
middleware (#1379)DefaultBodyLimit::max
for changing the default body limit (#1397)v0.5.16
: axum - v0.5.16Compare Source
Security
breaking: Added default limit to how much data
Bytes::from_request
willconsume. Previously it would attempt to consume the entire request body
without checking its length. This meant if a malicious peer sent an large (or
infinite) request body your server might run out of memory and crash.
The default limit is at 2 MB and can be disabled by adding the new
DefaultBodyLimit::disable()
middleware. See its documentation for moredetails.
This also applies to these extractors which used
Bytes::from_request
internally:
Form
Json
String
Thanks to Shachar Menashe for reporting this vulnerability.
(#1346)
v0.5.15
: axum - v0.5.15Compare Source
Note: This is a re-release of 0.5.14 that fixes an accidental breaking change.
QueryRejection
response. (#1171)v0.5.14
: axum - v0.5.14Compare Source
Yanked, as it contained an accidental breaking change.
clap-rs/clap
v4.0.25
Compare Source
Features
v4.0.24
Compare Source
Fixes
v4.0.23
Compare Source
Fixes
help
subcommandv4.0.22
Compare Source
Fixes
v4.0.21
Compare Source
Features
long_about
andlong_help
attributes, without a value, force using doc comment (before it wouldn't be set if there wasn't anything different than the short help)v4.0.20
Compare Source
Fixes
v4.0.19
Compare Source
Features
ColorChoice
now implementsValueEnum
v4.0.18
Compare Source
Fixes
#[command(skip)]
to also work with enum variants with a valuev4.0.17
Compare Source
Fixes
Arg::last(true)
withArg::value_hint(ValueHint::CommandWithArguments)
v4.0.16
Compare Source
Fixes
Arg::exclusive(true)
should not be exclusive with the argument's ownArgGroup
v4.0.15
Compare Source
Fixes
--
when it doesn't helpv4.0.14
Compare Source
Fixes
ArgGroup
inArgMatches
when explicitly specified, fixing derives handling of option-flattened fields (#4375)v4.0.13
Compare Source
Features
()
for fields to mean "don't read" (#4371)v4.0.12
Compare Source
Features
TypedValueParser::try_map
for when adapting an existingTypedValueParser
can failError::new
,Error::with_cmd
, andError::insert
v4.0.11
Compare Source
Fixes
v4.0.10
Compare Source
Features
#[arg(flatten)]
onOption
types (#4211, #4350)v4.0.9
Compare Source
Fixes
#[command(subcommand)]
like in clap v3v4.0.8
Compare Source
Fixes
Help
andVersion
actionsv4.0.7
Compare Source
Features
Fixes
#[group(skip)]
onParser
derivev4.0.6
Compare Source
Features
#[group(skip)]
(#4279, #4301)v4.0.5
Compare Source
v4.0.4
Compare Source
Fixes
v4.0.3
Compare Source
Fixes
--
) suggestionsv4.0.2
Compare Source
Features
v4.0.1
Compare Source
Features
ColorChoice
now implementsValueEnum
v4.0.0
Compare Source
Highlights
Arg::num_args(range)
Clap has had several ways for controlling how many values will be captured without always being clear on how they interacted, including
Arg::multiple_values(true)
Arg::number_of_values(4)
Arg::min_values(2)
Arg::max_values(20)
Arg::takes_value(true)
These have now all been collapsed into
Arg::num_args
which accepts bothsingle values and ranges of values.
num_args
controls how many raw argumentson the command line will be captured as values per occurrence and independent
of value delimiters.
See Issue 2688 for more background.
Polishing Help
Clap strives to give a polished CLI experience out of the box with little
ceremony. With some feedback that has accumulated over time, we took this
release as an opportunity to re-evaluate our
--help
output to make sure it ismeeting that goal.
In doing this evaluation, we wanted to keep in mind:
Before:
After:
--version
is available for showing the same thing (if the program has a version set)In talking to users, we found some that liked clap's
man
-like experience.When deviating from this, we are making the assumption that those are more
power users and that the majority of users wouldn't look as favorably on being
consistent with
man
.See Issue 4132 for more background.
More Dynamicism
Clap's API has focused on
&str
for performance but this can makedealing with owned data difficult, like
#[arg(default_value_t)]
generating aString from the default value.
Additionally, to avoid
ArgMatches
from borrowing (and for some features wedecided to forgo), clap took the
&str
argument IDs and hashed them. Thisprevented us from providing a usable API for iterating over existing arguments.
Now clap has switched to a string newtype that gives us the flexibility to
decide whether to use
&'static str
,Cow<'static, str>
for fast dynamic behavior, orBox<str>
for dynamic behavior with small binary size.As an extension of that work, you can now call
ArgMatches::ids
to iterateover the arguments and groups that were found when parsing. The newtype
Id
was used to prevent some classes of bugs and to make it easier to understand
when opaque Ids are used vs user-visible strings.
Clearing Out Deprecations
Instead of doing all development on clap 4.0.0, we implemented a lot of new features during clap 3's development, deprecating the old API while introducing the new API, including:
ArgAction
ValueParser
APIPathBuf
(allowing invalid UTF-8)AppSettings
andArgSettings
enums with getters/settersMigrating
Steps:
-h
and--help
output at a minimum (recommendation: trycmd for snapshot testing)arg.action(ArgAction::...)
on each argument (StoreValue
for options andIncOccurrences
for flags)cargo check --features clap/deprecated
and resolve all deprecation warningsdefault-features = false
, runcargo add clap -F help,usage,error-context
cargo add clap -F wrap_help
unless you want to hard code line wrapsExample test (derive):
Example test (builder):
Note: the idiomatic / recommended way of specifying different types of args in the Builder API has changed:
Before
After:
In particular,
num_args
(the replacement fortakes_value
) will default appropriatelyfrom the
ArgAction
and generally only needs to be set explicitly for theother
num_args
use cases.Breaking Changes
Subtle changes (i.e. compiler won't catch):
arg!
now sets one of (#3795):ArgAction::SetTrue
, requiringArgMatches::get_flag
instead ofArgMatches::is_present
ArgAction::Count
, requiringArgMatches::get_count
instead ofArgMatches::occurrences_of
ArgAction::Set
, requiringArgMatches::get_one
instead ofArgMatches::value_of
ArgAction::Append
, requiringArgMatches::get_many
instead ofArgMatches::values_of
ArgAction::Set
,ArgAction::SetTrue
, andArg::Action::SetFalse
nowconflict by default to be like
ArgAction::StoreValue
andArgAction::IncOccurrences
, requiringcmd.args_override_self(true)
to override instead (#4261)Arg
s default action isArgAction::Set
, rather thanArgAction::IncOccurrence
to reduce confusing magic through consistency (#2687, #4032, see also #3977)mut_arg
can no longer be used to customize help and version arguments, instead disable them (Command::disable_help_flag
,Command::disable_version_flag
) and provide your own (#4056)Command
,Arg
,ArgGroup
, andPossibleValue
, assuming'static
.string
feature flag will enable support forString
s (#1041, #2150, #4223)arg!(--flag <value>)
is now optional, instead of required. Add.required(true)
at the end to restore the original behavior (#4206)help
,usage
anderror-context
, requiring adding them back in ifdefault-features = false
(#4236)""
argument for external subcommands to make it easier to distinguish them from built-in commands (#3263)Arg::allow_hyphen_values
, to be consistent withCommand::allow_hyphen_values
(#4187)Arg::value_terminator
must be its own argument on the CLI rather than being in a delimited list (#4025)wrap_help
feature flag, either enable it or hard code your wraps (#4258)DeriveDisplayOrder
the default and removed the setting. To sort help, setnext_display_order(None)
(#2808)Command::next_display_order
instead ofDeriveDisplayOrder
and using its own initial display order value (#2808)Command::help_template
(#4132)Command::help_template
,Arg::help_heading
, andCommand::subcommand_help_heading
(#4132)COMMAND
for the value name. To get the old behavior, seeCommand::subcommand_help_heading
andArg::subcommand_value_name
(#4132, #4155)Command::help_template
. (#4132, #4160)--help
and--version
like anyArgAction::SetTrue
flag (#3776)Arg::id
asverbatim
casing, requiring updating of string references to other args like inconflicts_with
orrequires
(#3282)ValueEnum
variants will now show up in--help
(#3312)Args
, andArgGroup
is created using the type's name, reserving it for future use (#2621, #4209)next_help_heading
can now leak out of a#[clap(flatten)]
, like all other command settings (#4222)Easier to catch changes:
ArgMatches
now returns the argId
s, rather than the values to reduce overhead and offer more flexibility. (#4072)Arg::number_of_values
(average-across-occurrences) toArg::num_args
(per-occurrence) (raw CLI args, not parsed values) (#2688, #4023)num_args(0)
no longer impliestakes_value(true).multiple_values(true)
(#4023)num_args(1)
no longer impliesmultiple_values(true)
(#4023)Arg::min_values
(across all occurrences) withArg::num_args(N..)
(per occurrence) to reduce confusion over different value count APIs (#4023)Arg::max_values
(across all occurrences) withArg::num_args(1..=M)
(per occurrence) to reduce confusion over different value count APIs (#4023)Arg::multiple_values(true)
withArg::num_args(1..)
andArg::multiple_values(false)
withArg::num_args(0)
to reduce confusion over different value count APIs (#4023)Arg::takes_value(true)
withArg::num_args(1)
andArg::takes_value(false)
withArg::num_args(0)
to reduce confusion over different value count APIsArg::require_value_delimiter
, either users could useArg::value_delimiter
or implement a custom parser withTypedValueParser
as it was mostly to makemultiple_values(true)
act likemultiple_values(false)
and isn't needed anymore (#4026)Arg::new("help")
andArg::new("version")
no longer implicitly disable thebuilt-in flags and be copied to all subcommands, instead disable
the built-in flags (
Command::disable_help_flag
,Command::disable_version_flag
) and mark the custom flags asglobal(true)
. (#4056)Arg::short('h')
no longer implicitly disables the short flag for help,instead disable
the built-in flags (
Command::disable_help_flag
,Command::disable_version_flag
) provide your ownArg::new("help").long("help").action(ArgAction::Help).global(true)
. (#4056)ArgAction::SetTrue
andArgAction::SetFalse
now prioritizeArg::default_missing_value
over their standard behavior (#4000)Arg::requires_ifs
andArg::default_value*_ifs*
to taking anArgPredicate
, removing ambiguity withNone
when accepting owned and borrowed types (#4084)PartialEq
andEq
fromCommand
so we could change external subcommands to use aValueParser
(#3990)Arg
,Command
, andArgGroup
calls were switched from accepting&[]
to[]
viaIntoIterator
to be more flexible (#4072)Arg::short_aliases
and other builder functions that took&[]
need the&
dropped (#4081)ErrorKind
andResult
moved into theerror
moduleErrorKind::EmptyValue
replaced withErrorKind::InvalidValue
to remove an unnecessary special case (#3676, #3968)ErrorKind::UnrecognizedSubcommand
replaced withErrorKind::InvalidSubcommand
to remove an unnecessary special case (#3676)allow_external_subcommands
fromString
toOsString
as that is less likely to cause bugs in user applications (#3990)Command::render_usage
now returns aStyledStr
(#4248)parse
tovalue_parser
, removingparse
support (#3827, #3981)#[clap(value_parser)]
and#[clap(action)]
are now redundantsubcommand_required(true).arg_required_else_help(true)
is set instead ofSubcommandRequiredElseHelp
to give more meaningful errors when subcommands are missing and to reduce redundancy (#3280)arg_enum
attribute in favor ofvalue_enum
to match the new name (we didn't have support in v3 to mark it deprecated) (#4127)Arg::default_missing_value
didn't requirenum_args(0..=N)
, now it does (#4023)Arg::long
are no longer allowed (#3691)value_names
thannum_args
(#2695)ArgAction::Version
is used#[track_caller]
s to make it easier to debug assertsoverrides_with
IDs are validoverrides_with
now that Actions replace itmut_arg
receiving an invalid arg ID ormut_subcommand
receiving an invalid command nameCompatibility
MSRV is now 1.60.0
Deprecated
Arg::use_value_delimiter
in favor ofArg::value_delimiter
to avoid having multiple ways of doing the same thingArg::requires_all
in favor ofArg::requires_ifs
now that it takes anArgPredicate
to avoid having multiple ways of doing the same thingArg::number_of_values
in favor ofArg::num_args
to clarify semantic differencesdefault_value_os
,default_values_os
,default_value_if_os
, anddefault_value_ifs_os
as the non_os
variants now accept either astr
or anOsStr
(#4141)Arg::env_os
in favor ofArg::env
Command::dont_collapse_args_in_usage
is now the default (#4151)Command::trailing_var_arg
in favor ofArg::trailing_var_arg
to make it clearer which arg it is meant to apply to (#4187)Command::allow_hyphen_values
in favor ofArg::allow_hyphen_values
to make it clearer which arg it is meant to apply to (#4187)Command::allow_negative_numbers
in favor ofArg::allow_negative_numbers
to make it clearer which arg it is meant to apply to (#4187)Command::write_help
andCommand::write_long_help
in favor ofCommand::render_help
andCommand::render_long_help
(#4248)structopt
andclap
attributes in favor of the more specificcommand
,arg
, andvalue
to open the door for more features and clarify relationship to the builder (#1807, #4180)#[clap(value_parser)]
and#[clap(action)]
defaulted attributes (its the default) (#3976)Behavior Changes
wrap_help
feature, if the terminal size cannot be determined,LINES
andCOLUMNS
variables are used (#4186)Features
Arg::num_args
now accepts ranges, allowing setting both the minimum and maximum number of values per occurrence (#2688, #4023)value_parser
s forArgAction::SetTrue
/ArgAction::SetFalse
(#4092)From<&OsStr>
,From<OsString>
,From<&str>
, andFrom<String>
tovalue_parser!
(#4257)Command
,Arg
,ArgGroup
,PossibleValue
, etc without managing lifetimes with thestring
feature flag (#2150, #4223)error-context
,help
andusage
feature flags that can be turned off for smaller binaries (#4236)StyledStr::ansi()
toDisplay
with ANSI escape codes (#4248)Error::apply
for changing the formatter for dropping binary size (#4111)Error::render
for formatting the error into aStyledStr
PossibleValue::help
in long help (--help
) (#3312){tab}
variable forCommand::help_template
(#4161)Command::render_help
andCommand::render_long_help
for formatting the error into aStyledStr
(#3873, #4248)Command::render_usage
now returns aStyledStr
(#4248)Fixes
required
is not used with conditional required settings (#3660)cmd.allow_invalid_for_utf8_external_subcommands
withcmd.external_subcommand_value_parser
(#3733)Arg::default_missing_value
now applies per occurrence rather than if a value is missing across all occurrences (#3998)arg!(--long [value])
to accept0..=1
per occurrence rather than across all occurrences, making it safe to use withArgAction::Append
(#4001)OsStr
s forArg::{required_if_eq,required_if_eq_any,required_if_eq_all}
(#4084)wrap_help
feature, if the terminal size cannot be determined,LINES
andCOLUMNS
variables are used (#4186)Command::display_name
in the help title rather thanCommand::bin_name
ArgAction::Count
by adding an...
(#4003)cmd help help
(#4131)[positional]
in list when relevant (#4144)[positional]
in usage (#4151)-h
/--help
when applicable (#4132, #4159)next_line_help
, don't add blank lines (#4132, #4190)Command::display_name
rather thanCommand::bin_name
(#3966)""
argument for external subcommands (#3263)Arg::allow_hyphen_values
, likeCommand::allow_hyphen_values
(#4187)InvalidSubcommand
overUnknownArgument
in more cases (#4219)Arg::id
asverbatim
casing (#3282)#[clap(value_parser, action)]
instead of#[clap(parse)]
(#3827)v3.2.23
Compare Source
[3.2.23] - 2022-10-24
Fixes
textwrap
0.16v3.2.22
Compare Source
[3.2.22] - 2022-09-16
Fixes
terminal_size
to the 0.2 releasev3.2.21
Compare Source
[3.2.21] - 2022-09-12
Features
TypedValueParser::map
to allow reusing existing value parsers for other purposesv3.2.20
Compare Source
[3.2.20] - 2022-09-02
Features
ArgMatches::get_count
help forArgAction::Count
ArgMatches::get_flag
help forArgAction::SetTrue
/ArgAction::SetFalse
v3.2.19
Compare Source
[3.2.19] - 2022-08-30
Fixes
args_conflicts_with_subcommand
v3.2.18
Compare Source
Fixes
Command::print_help
now respectsCommand::colored_help
v3.2.17
Compare Source
Fixes
#[clap(id = ...)]
attribute to match Arg's latest APIv3.2.16
Compare Source
Fixes
v3.2.15
Compare Source
Features
default_values_t
anddefault_values_os_t
attributesv3.2.14
Compare Source
Fixes
multiple_values
positional followed by another positional now works with multiple flagsv3.2.13
Compare Source
Documentation
v3.2.12
Compare Source
Fixes
v3.2.11
Compare Source
Features
Arg::get_all_short_aliaes
andArg::get_all_aliases
v3.2.10
Compare Source
Fixes
Command::mut_subcommand
v3.2.8
Compare Source
Features
Command::mut_subcommand
to mirrorCommand::mut_arg
v3.2.7
Compare Source
Fixes
v3.2.6
Compare Source
Fixes
--=
v3.2.5
Compare Source
Fixes
#[clap(default_value_os_t ...)]
introduced in v3.2.3v3.2.4
Compare Source
Fixes
#[clap(parse)]
attribute (#3832)v3.2.3
Compare Source
Fixes
deprecated
Cargo.toml feature (#3830)default as we release the next major version to help draw attention to the
deprecation migration path
v3.2.2
Compare Source
Fixes
gated behind
unstable-v4
#[clap(value_parser, action)]
instead of#[clap(parse)]
(#3827)v3.2.1
Compare Source
Fixes
Command::print_help
now respectsCommand::colored_help
v3.2.0
Compare Source
Compatibility
MSRV is now 1.56.0 (#3732)
Behavior
required
and its variants (#3793)ArgMatches::value_of
and friends, debug asserts were turned into panicsMoving (old location deprecated)
clap::{PossibleValue, ValueHint}
toclap::builder::{PossibleValue, ValueHint}
clap::{Indices, OsValues, ValueSource, Values}
toclap::parser::{Indices, OsValues, ValueSource, Values}
clap::ArgEnum
toclap::ValueEnum
(#3799)Replaced
Arg::allow_invalid_utf8
withArg::value_parser(value_parser!(PathBuf))
(#3753)Arg::validator
/Arg::validator_os
withArg::value_parser
(#3753)Arg::validator_regex
with users providing their ownbuilder::TypedValueParser
(#3756)Arg::forbid_empty_values
withbuilder::NonEmptyStringValueParser
/builder::PathBufValueParser
(#3753)Arg::possible_values
withArg::value_parser([...])
,builder::PossibleValuesParser
, orbuilder::EnumValueParser
(#3753)Arg::max_occurrences
witharg.action(ArgAction::Count).value_parser(value_parser!(u8).range(..N))
for flags (#3797)Arg::multiple_occurrences
withArgAction::Append
orArgAction::Count
though positionals will needArg::multiple_values
(#3772, #3797)Command::args_override_self
withArgAction::Set
(#2627, #3797)AppSettings::NoAutoVersion
withArgAction
orCommand::disable_version_flag
(#3800)AppSettings::NoHelpVersion
withArgAction
orCommand::disable_help_flag
/Command::disable_help_subcommand
(#3800)ArgMatches::{value_of, value_of_os, value_of_os_lossy, value_of_t}
withArgMatches::{get_one,remove_one}
(#3753)ArgMatches::{values_of, values_of_os, values_of_os_lossy, values_of_t}
withArgMatches::{get_many,remove_many}
(#3753)ArgMatches::is_valid_arg
withArgMatches::{try_get_one,try_get_many}
(#3753)ArgMatches::occurrences_of
withArgMatches::value_source
orArgAction::Count
(#3797)ArgMatches::is_present
withArgMatches::contains_id
orArgAction::SetTrue
(#3797)ArgAction::StoreValue
withArgAction::Set
orArgAction::Append
(#3797)ArgAction::IncOccurrences
withArgAction::SetTrue
orArgAction::Count
(#3797)#[clap(parse(...))]
replaced with: (#3589, #3794)parse
attribute), deprecation warnings can besilenced by opting into the new behavior by adding either
#[clap(action)]
or
#[clap(value_parser)]
(ie requesting the default behavior for theseattributes). Alternatively, the
unstable-v4
feature changes the defaultaway from
parse
toaction
/value_parser
.#[clap(parse(from_flag))]
replaced with#[clap(action = ArgAction::SetTrue)]
(#3794)#[clap(parse(from_occurrences))]
replaced with#[clap(action = ArgAction::Count)]
though the field's type must beu8
(#3794)#[clap(parse(from_os_str)]
forPathBuf
, replace it with#[clap(value_parser)]
(as mentioned earlier this will callvalue_parser!(PathBuf)
which will auto-select the rightValueParser
automatically).
#[clap(parse(try_from_str = ...)]
, replace it with#[clap(value_parser = ...)]
TypedValueParser
will be needed and specify it with#[clap(value_parser = ...)]
Features
Arg::value_parser
/ArgMatches::{get_one,get_many}
(#2683, #3732)TypedValueParser
s available with an API open for expansionvalue_parser!(T)
macro for selecting a parser for a given type (#3732) and open to expansion via theValueParserFactory
trait (#3755)[&str]
is implicitly a value parser for possible valuesArgMatches
getters do not assume required arguments (#2505)ArgMatches::remove_*
variants to transfer ownershipArgMatches::try_*
variants to avoid panics for developer errors (#3621)get_raw
to access the underlyingOsStr
sPathBuf
value parsers implyValueHint::AnyPath
for completions (#3732)Arg::action
(#3774)ArgAction::StoreValue
: existingtakes_value(true)
behaviorArgAction::IncOccurrences
: existingtakes_value(false)
behaviorArgAction::Help
: existing--help
behaviorArgAction::Version
: existing--version
behaviorArgAction::Set
: Overwrite existing values (likeArg::multiple_occurrences
mixed withCommand::args_override_self
) (#3777)ArgAction::Append
: likeArg::multiple_occurrences
(#3777)ArgAction::SetTrue
: Treat--flag
as--flag=true
(#3775)Arg::default_value("false")
(#3786)Arg::env
viaArg::value_parser
ArgAction::SetFalse
: Treat--flag
as--flag=false
(#3775)Arg::default_value("true")
(#3786)Arg::env
viaArg::value_parser
ArgAction::Count
: Treat--flag --flag --flag
as--flag=1 --flag=2 --flag=3
(#3775)Arg::default_value("0")
(#3786)Arg::env
viaArg::value_parser
Arg::value_parser
/Arg::action
with either#[clap(value_parser)]
(#3589, #3742) /#[clap(action)]
attributes (#3794)ValueParser
is determined byvalue_parser!
(#3199, #3496)ArgAction
is determine by a hard-coded lookup on the type (#3794)Command::multicall
is now stable for busybox-like programs and REPLs (#2861, #3684)ArgMatches::{try_,}contains_id
for checking if there are values for an argument that mirrors the newget_{one,many}
APIFixes
default_value_ifs_os
(#3815)parser
ArgMatches::value_source
andArgMatches::occurrences_of
for external subcommands (#3732)Arg::default_missing_values
(#3761, #3765)Arg::default_value
/Arg::env
on value delimiters independent of whether--
was used (#3765)required
and its variants (#3793)v3.1.18
Compare Source
Fixes
arg_enum!
for users migrating to clap3 (#3717)required_unless_present_all
arguments exist...
when not enoughvalue_names
are suppliedgated behind
unstable-v4
required
is not used with conditional required settings (#3660)value_names
thannumber_of_values
(#2695)""
argument for external subcommands (#3263)Arg::id
asverbatim
casing (#3282)v3.1.17
Compare Source
Fixes
arg!
macro to have dashes when quoted, like longsv3.1.16
Compare Source
Fixes
Arg::exclusive
overridesArg::required
, like other conflictshelp_template
variable{name}
to fix problems with{bin}
gated behind
unstable-v4
Arg::long
are no longer allowedCommand::display_name
in the help title rather thanCommand::bin_name
v3.1.15
Compare Source
Fixes
v3.1.14
Compare Source
Fixes
Command::build
with a required positional argument nested several layers in subcommandsv3.1.13
Compare Source
Fixes
Command::write_help
now report required arguments in usage in more circumstancesdebug
featurecolor
feature withdebug
feature enabledv3.1.12
Compare Source
Fixes
v3.1.11
Compare Source
Fixes
Arg::required
, making the behavior consistent with how we calculate conflicts for error reportingArgGroup
overrideArg::required
, making the behavior consistent with how we calculate conflicts for error reportingArg::overrides_with
always overrideArg::required
, not just when the parser processes an overridev3.1.10
Compare Source
Features
Command::build
for custom help generation or other command introspection needsv3.1.9
Compare Source
Fixes
clap_derive
version so a compatible version is always used withclap
v3.1.8
Compare Source
Fixes
Debug
impls to more typesv3.1.7
Compare Source
Fixes
ArgEnum
with non-unit unskipped variantsv3.1.6
Compare Source
Fixes
cargo
feature is neededv3.1.5
Compare Source
Fixes
v3.1.4
Compare Source
Features
PossibleValue::help
in long help (--help
) (gated behindunstable-v4
) (#3312)v3.1.3
Compare Source
Fixes
v3.1.2
Compare Source
Fixes
Documentation
v3.1.1
Compare Source
Fixes
arg_enum!
for users migrating to clap3 (#3717)required_unless_present_all
arguments exist...
when not enoughvalue_names
are suppliedgated behind
unstable-v4
required
is not used with conditional required settings (#3660)value_names
thannumber_of_values
(#2695)""
argument for external subcommands (#3263)Arg::id
asverbatim
casing (#3282)v3.1.0
Compare Source
Compatibility
Changes in behavior of note that are not guaranteed to be compatible across releases:
help
subcommand shows long help like--help
, rather than short help (-h
), deprecatedclap::AppSettings::UseLongFormatForHelpSubcommand
(#3440)Deprecations
clap::Command
is now preferred overclap::App
(#3089 in #3472)clap::command!
is now preferred overclap::app_from_crate
(#3089 in #3474)clap::CommandFactory::command
is now preferred overclap::IntoApp::into_app
(#3089 in #3473)help
subcommand shows long help like--help
, rather than short help (-h
), deprecatedclap::AppSettings::UseLongFormatForHelpSubcommand
(#3440)clap::AppSettings::WaitOnError
, leaving it to the user to implementclap::Command::subcommand_required(true).arg_required_else_help(true)
is now preferred overclap::AppSettings::SubcommandRequiredElseHelp
(#3280)clap::AppSettings
are nearly all deprecated and replaced with builder methods and getters (#2717)clap::ArgSettings
is deprecated and replaced with builder methods and getters (#2717)clap::Arg::id
andclap::ArgGroup::id
are now preferred overclap::Arg::name
andclap::ArgGroup::name
(#3335)clap::Command::next_help_heading
is now preferred overclap::Command::help_heading
(#1807, #1553)clap::error::ErrorKind
is now preferred overclap::ErrorKind
(#3395)clap::Error::kind()
is now preferred overclap::Error::kind
clap::Error::context()
is now preferred overclap::Error::info
(#2628)Note: All items deprecated in 3.0.0 are now hidden in the documentation. (#3458)
Features
clap::ArgMatches::value_source
to determine what insert the value (#1345)clap::Command::next_display_order
(#1807)clap::Error::context
API to open the door for fully-custom error messages (#2628)clap::error::ErrorKind
now implementsDisplay
Fixes
clap::Command::color
to override previous calls (#3449)ArgRequiredElseHelp
precedence overSubcommandRequired
(#3456)clap::Command::arg_required_else_help
, etc (#3076, #1264)-h
conflicts (#3403)--help
(#1549)clap::error::Result
(#3395)Performance
clap::Error
(#3395)Documentation
clap::Arg::validator
parse
attributev3.0.14
Compare Source
Features
ArgMatches::args_present()
to check if any args are presentError::kind()
as we work to deprecate direct member access forError
App::get_version
App::get_long_version
App::get_author
App::get_subcommand_help_heading
App::get_subcommand_value_name
App::get_after_help
App::get_after_long_help
Performance
v3.0.13
Compare Source
Fixes
[]
v3.0.12
Compare Source
Features
default_value_os_t
v3.0.11
Compare Source
Fixes
v3.0.10
Compare Source
Fixes
panic!
from v3.0.8 when usingglobal_setting(PropagateVersion)
.v3.0.9
Compare Source
Features
App::find_subcommand_mut
v3.0.8
Compare Source
Fixes
DisableColoredHelp
oncmd help help
cmd help
v3.0.7
Compare Source
Fixes
App
building (ie will now run inApp::debug_assert
)derive
v3.0.6
Compare Source
Fixes
derive
use clap::ArgEnum
(#3277)v3.0.5
Compare Source
Fixes
docs:
ArgMatches
assertsParser::from_clap
(#3257)v3.0.4
Compare Source
Features
cargo
, exposeArgMatches::is_valid_arg
to avoid panicing on undefined argumentsv3.0.3
Compare Source
Fixes
v3.0.2
Compare Source
Fixes
Last
when checking hyphen values (see #3249 for details)#[must_use]
v3.0.1
Compare Source
Features
ArgMatches::args_present()
to check if any args are presentError::kind()
as we work to deprecate direct member access forError
App::get_version
App::get_long_version
App::get_author
App::get_subcommand_help_heading
App::get_subcommand_value_name
App::get_after_help
App::get_after_long_help
Performance
asomers/mockall
v0.11.3
Compare Source
v0.11.2
Compare Source
Fixed
Suppress "dead code" warnings when automocking a struct's private method. It
might be used only by other public methods in the same struct.
(#397)
Fixed using Mockall when a function named
Ok
is in scope. Theanyhow
crate, for example, creates a function by this name.
(#389)
serde-rs/serde
v1.0.147
Compare Source
serde::de::value::EnumAccessDeserializer
which transforms anEnumAccess
into aDeserializer
(#2305)v1.0.146
Compare Source
v1.0.145
Compare Source
Sized
(#2282, thanks @ChayimFriedman2)v1.0.144
Compare Source
v1.0.143
Compare Source
v1.0.142
Compare Source
v1.0.141
Compare Source
no-std
category to crates.io metadatav1.0.140
Compare Source
v1.0.139
Compare Source
new
constructor function for allIntoDeserializer
impls (#2246)v1.0.138
Compare Source
v1.0.137
Compare Source
rust-version
of serde and serde_test (#2168)serde-rs/json
v1.0.87
Compare Source
write_i128
andwrite_u128
methods toserde_json::Formatter
to control the formatting of 128-bit integers (#940, thanks @Lucretiel)v1.0.86
Compare Source
arbitrary_precision
feature even in no-std mode (#928, thanks @kvinwang)v1.0.85
Compare Source
Display
forNumber
produce the same representation as serializing (#919)v1.0.84
Compare Source
Debug
impl ofserde_json::Value
more compact (#918)v1.0.83
Compare Source
v1.0.82
Compare Source
From<Option<T>>
for serde_json::Value whereT: Into<Value>
(#900, thanks @kvnvelasco)v1.0.81
Compare Source
indexmap
/autocfg
not always properly detecting whether astd
sysroot crate is available (#885, thanks @cuviper)v1.0.80
Compare Source
v1.0.79
Compare Source
RawValue
deserialization to propagate\u
escapes for unmatched surrogates, which can later by deserialized to Vec<u8> (#830, thanks @lucacasonato)v1.0.78
Compare Source
&RawValue
in map key position, which would previously fail with "invalid type: newtype struct" (#851)v1.0.77
Compare Source
std
noralloc
feature enabledv1.0.76
Compare Source
raw_value
andalloc
are enabled whilestd
is disabled (#850)v1.0.75
Compare Source
v1.0.74
Compare Source
v1.0.73
Compare Source
itoa
dependency to 1.0v1.0.72
Compare Source
\u
-encoded lone surrogates when deserializing into a byte string (#828, #829, thanks @lucacasonato)v1.0.71
Compare Source
v1.0.70
Compare Source
serde_json::Map::retain
method (#822, thanks @deankarn)v1.0.69
Compare Source
launchbadge/sqlx
v0.6.2
Compare Source
25 pull requests were merged this release cycle.
Added
Changed
Fixed
v0.6.1
Compare Source
33 pull requests were merged this release cycle.
Added
Changed
Fixed
v0.6.0
Compare Source
This release marks the end of the 0.5.x series of releases and contains a number of breaking changes,
mainly to do with backwards-incompatible dependency upgrades.
As we foresee many more of these in the future, we surveyed the community on how to handle this;
the consensus appears to be "just release breaking changes more often."
As such, we expect the 0.6.x release series to be a shorter one.
39 pull requests(!) (not counting "prepare 0.5.12 release", of course) were merged this release cycle.
Breaking
Added
Changed
Fixed
v0.5.13
Compare Source
This is a hotfix that reverts [#1748] as that was an accidental breaking change:
the generated
PgHasArrayType
impl conflicts with manual impls of the trait.This change will have to wait for 0.6.0.
v0.5.12
Compare Source
27 pull requests were merged this release cycle.
Added
Changed
Fixed
v0.5.11
Compare Source
20 pull requests were merged this release cycle.
Added
Changed
Fixed
Additionally, we have introduced two mitigations for the issue of the cyclic dependency on
ahash
:indexmap
from1.7.0
back to1.6.2
so users can pin it to thatversion as recommended in aHash#95.
sorry about that.
preserve_order
feature ofserde_json
which gives users another place to break the cycle by simply not enabling that feature.sqlx-data.json
, however. If this is an issue for you butthe dependency cycle isn't, you can re-enable the
preserve_order
feature:v0.5.10
Compare Source
A whopping 31 pull requests were merged this release cycle!
According to this changelog, we saw 18 new contributors! However, some of these folks may have missed getting
mentioned in previous entries since we only listed highlights. To avoid anyone feeling left out, I put in the effort
this time and tried to list every single one here.
Added
Changes
Fixes
v0.5.9
Compare Source
A hotfix release to address the issue of the
sqlx
crate itself still depending on older versions ofsqlx-core
andsqlx-macros
.No other changes from
0.5.8
.v0.5.8
Compare Source
A total of 24 pull requests were merged this release cycle! Some highlights:
v0.5.7
Compare Source
v0.5.6
Compare Source
A large bugfix release, including but not limited to:
A total of 25 pull requests were merged this release cycle!
v0.5.5
Compare Source
v0.5.4
Compare Source
v0.5.3
Compare Source
v0.5.2
Compare Source
PostgreSQL
SQLite
time-rs/time
v0.3.17
Compare Source
Changed
time::serde::format_description!
is reduced if not all featureflags are active.
cargo test --tests
works with any configuration of feature flags. This occurs by spawning asubprocess that passes
--all-features
.cargo test --doc
works with most combinations offeature flags, including the default. The combination of these changes means that crater will now
run on
time
.libc
andnum_threads
are only included as dependencies when needed. They were previouslyunconditionally included.
Added
time::format_description::parse_owned
, which returns anOwnedFormatItem
. This avoids "lifetimehell", where all your structs now need a lifetime because a single field has one. Note that when
possible, the borrowed format item (just called
FormatItem
) is still preferred, as it hassignificantly fewer allocations. The new
OwnedFormatItem
is usable for both formatting andparsing, as you would expect.
Compatibility
errors have slightly changed. No existing API has been altered, so this is not a breaking change.
However, you may notice different errors, which are hopefully better! The parser for compile-time
format descriptions has not yet been swapped out. If you notice any bugs, please file an issue.
v0.3.16
Compare Source
Changed
serde-well-known
feature flag is deprecated. The necessary features for an item to beenabled are indicated in documentation.
Added
const
s can now be provided as the format description fortime::serde::format_description!
. Theconst
must be of type&[FormatItem<'_>]
, which is what is returned by thetime::macros::format_description!
macro.Compatibility
was unsupported. These flags are:
js-sys
quickcheck-dep
itoa
time-macros
v0.3.15
Compare Source
Changed
tm_gmtoff
extension. This should eliminate build failures on some untestedplatforms.
Debug
output for types are now human-readable. While this should not be relied upon, it iscurrently the same as the output with
Display
.panic. This was previously only the case in debug mode.
NaN
is passed toDuration::from_secs_f32
orDuration::from_secs_f64
.Fixed
OffsetDateTime
to anotherUtcOffset
. Thisoccurred due to an old assumption in code that was no longer the case.
v0.3.14
Compare Source
Changed
Duration::unsigned_abs
is nowconst fn
.time::format_description::well_known::Iso8601
now has a default. Thismeans
Iso8601
is the same asIso8601::DEFAULT
.Parsed
struct has been reduced in size from 56 to 32 bytes (a 43% reduction).v0.3.13
Compare Source
Fixed
wasm-bindgen
work again.v0.3.12
Compare Source
Added
js-sys
now supports obtaining the system's local UTC offset.Changed
Date
operations has improved when using thelarge-dates
feature.OffsetDateTime
now stores the value in the attachedUtcOffset
, notUTC. This leads to significant performance gains on nearly all
OffsetDateTime
methods.Fixed
Time
s can no longer panic. This previously occurred in some situations where theresult was invalid.
v0.3.11
Compare Source
Fixed
v0.3.10
Compare Source
Added
Duration::unsigned_abs
, which returns astd::time::Duration
Duration
can now be formatted with a.N
specifier, providing a shorter representation whenusing
Display
.null
asNone
on serde structsFixed
Rfc3339
.Changed
Rfc2822
has been improved.only serves to catch bugs and is disabled in release mode.
v0.3.9
Added
time::serde::format_description!
time::format_description!
, but it generates a module that can be usedin
#[serde(with = "foo")]
. This makes it far easier to serialize/deserialize a custom format.Date::replace_year
Date::replace_month
Date::replace_day
Time::replace_hour
Time::replace_minute
Time::replace_second
Time::replace_millisecond
Time::replace_microsecond
Time::replace_nanosecond
PrimitiveDateTime::replace_year
PrimitiveDateTime::replace_month
PrimitiveDateTime::replace_day
PrimitiveDateTime::replace_hour
PrimitiveDateTime::replace_minute
PrimitiveDateTime::replace_second
PrimitiveDateTime::replace_millisecond
PrimitiveDateTime::replace_microsecond
PrimitiveDateTime::replace_nanosecond
OffsetDateTime::replace_year
OffsetDateTime::replace_month
OffsetDateTime::replace_day
OffsetDateTime::replace_hour
OffsetDateTime::replace_minute
OffsetDateTime::replace_second
OffsetDateTime::replace_millisecond
OffsetDateTime::replace_microsecond
OffsetDateTime::replace_nanosecond
Parsed::offset_minute_signed
Parsed::offset_second_signed
Parsed::set_offset_minute_signed
Parsed::set_offset_second_signed
Parsed::with_offset_minute_signed
Parsed::with_offset_second_signed
error::InvalidVariant
impl FromStr
forWeekday
impl FromStr
forMonth
impl Display for Duration
Deprecated
The following methods have been deprecated in favor of the new, signed equivalent methods. The
pre-existing methods
Parsed::offset_minute
Parsed::offset_second
Parsed::set_offset_minute
Parsed::set_offset_second
Parsed::with_offset_minute
Parsed::with_offset_second
Changed
TryFromParsed::ComponentRange
errorvariant if the leap second could not occur at that given moment.
v0.3.8
This release is broken and has been yanked.
v0.3.7
Compare Source
Fixed
Solaris and Illumos build again.
v0.3.6
Compare Source
Added
Date::saturating_add
Date::saturating_sub
PrimitiveDateTime::saturating_add
PrimitiveDateTime::saturating_sub
OffsetDateTime::saturating_add
OffsetDateTime::saturating_sub
PrimitiveDatetime::MIN
PrimitiveDatetime::MAX
Rfc2822
format descriptionserde-well-known
feature flag.Changed
num_threads
crate.format fails to deserialize.
Fixed
v0.3.5
Compare Source
Added
Date::checked_add
Date::checked_sub
PrimitiveDateTime::checked_add
PrimitiveDateTime::checked_sub
OffsetDateTime::checked_add
OffsetDateTime::checked_sub
Changed
single-threaded. This does not affect other Unix platforms. As a reminder, the relevant methods
are fallible and may return an
Err
value for any reason.v0.3.4
Compare Source
Added
error::DifferentVariant
andError::DifferentVariant
impl From<Component> for FormatItem<'_>
impl TryFrom<FormatItem<'_>> for Component
impl<'a> From<&'a [FormatItem<'_>]> for FormatItem<'a>
impl<'a> TryFrom<FormatItem<'a>> for &[FormatItem<'a>]
impl PartialEq<Component> for FormatItem<'_>
impl PartialEq<FormatItem<'_>> for Component
impl PartialEq<&[FormatItem<'_>]> for FormatItem<'_>
impl PartialEq<FormatItem<'_>> for &[FormatItem<'_>]
impl TryFrom<Error> for error::TryFromParsed
impl TryFrom<Error> for error::Parse
impl TryFrom<Error> for error::ParseFromDescription
impl TryFrom<Error> for error::InvalidFormatDescription
impl TryFrom<Error> for error::IndeterminateOffset
impl TryFrom<Error> for error::Format
impl TryFrom<Error> for error::ConversionRange
impl TryFrom<Error> for error::ComponentRange
impl TryFrom<error::TryFromParsed> for error::ComponentRange
impl TryFrom<error::Parse> for error::TryFromParsed
impl TryFrom<error::Parse> for error::ParseFromDescription
impl TryFrom<error::Format> for std::io::Error
impl Sum for Duration
impl Sum<&Duration> for Duration
const fn default()
has been added to all modifiers that arestruct
s. These methods exist topermit construction in
const
contexts and may be removed (without being considered a breakingchange) once
impl const Default
is stabilized.FormatItem::Optional
, which will consume the contained value if present but still succeedotherwise.
FormatItem::First
, which will consume the first successful parse, ignoring any prior errors.Fixed
UtcOffset
component now indicates the error comes from the offset.v0.3.3
Compare Source
Added
Parsed::parse_item
Parsed::parse_items
Parsed::parse_literal
Parsed
format_description!
macro now supports thecase_sensitive
modifier.Changed
The minimum supported version is now 1.51.0.
v0.3.2
Compare Source
Added
Instant
is now#[repr(transparent)]
Fixed
Date
from its ISO year, week, and weekday now returns the correct value in allcircumstances. Previously, dates with an ISO year less than zero may have returned incorrect
values. This affects both the
Date::from_iso_week_date
method and thedate!
macro.v0.3.1
Compare Source
Changed
time::serde::format_description!
is reduced if not all featureflags are active.
cargo test --tests
works with any configuration of feature flags. This occurs by spawning asubprocess that passes
--all-features
.cargo test --doc
works with most combinations offeature flags, including the default. The combination of these changes means that crater will now
run on
time
.libc
andnum_threads
are only included as dependencies when needed. They were previouslyunconditionally included.
Added
time::format_description::parse_owned
, which returns anOwnedFormatItem
. This avoids "lifetimehell", where all your structs now need a lifetime because a single field has one. Note that when
possible, the borrowed format item (just called
FormatItem
) is still preferred, as it hassignificantly fewer allocations. The new
OwnedFormatItem
is usable for both formatting andparsing, as you would expect.
Compatibility
errors have slightly changed. No existing API has been altered, so this is not a breaking change.
However, you may notice different errors, which are hopefully better! The parser for compile-time
format descriptions has not yet been swapped out. If you notice any bugs, please file an issue.
v0.3.0
Compare Source
Added
datetime!
macro, which allows the construction of a statically verifiedPrimitiveDateTime
orOffsetDateTime
.PrimitiveDateTime::replace_time
PrimitiveDateTime::replace_date
OffsetDateTime::replace_time
OffsetDateTime::replace_date
OffsetDateTime::replace_date_time
OffsetDateTime::replace_offset
#![no_alloc]
supportDate::to_iso_week_date
, replacingDate::iso_year_week
Date::MIN
Date::MAX
UtcOffset::from_hms
UtcOffset::from_whole_seconds
UtcOffset::as_hms
UtcOffset::whole_hours
UtcOffset::whole_minutes
UtcOffset::minutes_past_hour
UtcOffset::seconds_past_minute
UtcOffset::is_utc
UtcOffset::is_positive
UtcOffset::is_negative
OffsetDateTime::sunday_based_week
OffsetDateTime::monday_based_week
PrimitiveDateTime::to_calendar_date
PrimitiveDateTime::to_ordinal_date
PrimitiveDateTime::to_iso_week_date
PrimitiveDateTime::to_julian_day
OffsetDateTime::to_calendar_date
OffsetDateTime::to_ordinal_date
OffsetDateTime::to_iso_week_date
OffsetDateTime::to_julian_day
Time::as_hms
Time::as_hms_milli
Time::as_hms_micro
Time::as_hms_nano
PrimitiveDateTime::as_hms
PrimitiveDateTime::as_hms_milli
PrimitiveDateTime::as_hms_micro
PrimitiveDateTime::as_hms_nano
OffsetDateTime::to_hms
OffsetDateTime::to_hms_milli
OffsetDateTime::to_hms_micro
OffsetDateTime::to_hms_nano
Duration::saturating_add
Duration::saturating_sub
Duration::saturating_mul
util::days_in_year_month
Month
Instant::into_inner
impl AsRef<StdInstant>
andimpl Borrow<StdInstant>
forInstant
user-provided flag. This functionality is not tested in any way and is not guaranteed to work.
Library authors are unable to enable this feature, as it must be passed via
RUSTFLAGS
. Furtherinformation is available in the documentation.
Changed
within the 0.3 series without being a breaking change.
macros
feature flag.OffsetDatetime::timestamp
→OffsetDateTime::unix_timestamp
OffsetDatetime::timestamp_nanos
→OffsetDateTime::unix_timestamp_nanos
Date::try_from_ymd
→Date::from_calendar_date
Date::try_from_yo
→Date::from_ordinal_date
Date::try_from_iso_ywd
→Date::from_iso_week_date
Date::as_ymd
→Date::to_calendar_date
Date::as_yo
→Date::to_ordinal_date
Date::try_with_hms
→Date::with_hms
Date::try_with_hms_milli
→Date::with_hms_milli
Date::try_with_hms_micro
→Date::with_hms_micro
Date::try_with_hms_nano
→Date::with_hms_nano
Time::try_from_hms
→Time::from_hms
Time::try_from_hms_milli
→Time::from_hms_milli
Time::try_from_hms_micro
→Time::from_hms_micro
Time::try_from_hms_nano
→Time::from_hms_nano
UtcOffset::try_local_offset_at
→UtcOffset::local_offset_at
UtcOffset::as_seconds
→UtcOffset::whole_seconds
OffsetDateTime::try_now_local
→OffsetDateTime::now_local
Date::week
→Date::iso_week
PrimitiveDateTime::week
→PrimitiveDateTime::iso_week
OffsetDateTime::week
→OffsetDateTime::iso_week
Date::julian_day
→Date::to_julian_day
Duration
unit values, as well as the minimum and maximum, are now associated constants.OffsetDateTime::unix_epoch()
→OffsetDateTime::UNIX_EPOCH
Time::midnight()
→Time::MIDNIGHT
const fn
(on at least newer compilers)Date::weekday
Date::next_day
Date::previous_day
PrimitiveDateTime::assume_offset
PrimitiveDateTime::weekday
Duration::checked_add
Duration::checked_sub
Duration::checked_mul
OffsetDateTime::from_unix_timestamp
OffsetDateTime::from_unix_timestamp_nanos
OffsetDateTime::date
OffsetDateTime::time
OffsetDateTime::year
OffsetDateTime::month
OffsetDateTime::day
OffsetDateTime::ordinal
OffsetDateTime::to_iso_week_date
OffsetDateTime::week
OffsetDateTime::weekday
OffsetDateTime::hour
OffsetDateTime::minute
OffsetDateTime::second
OffsetDateTime::millisecond
OffsetDateTime::microsecond
OffsetDateTime::nanosecond
OffsetDateTime::unix_timestamp
OffsetDateTime::unix_timestamp_nanos
Result
:Date::from_julian_day
OffsetDateTime::from_unix_timestamp
OffsetDateTime::from_unix_timestamp_nanos
Option
:Date::next_day
Date::previous_day
large-dates
feature, this is increased to ±999,999. Enabling the feature has performance implications and
introduces ambiguities when parsing.
local-offset
feature:UtcOffset::local_offset_at
OffsetDateTime::now_local
Instant
is now guaranteed to be represented as a tuple struct containing astd::time::Instant
.Date::to_julian_day
now returns ani32
(wasi64
).Date::from_julian_day
now accepts ani32
(wasi64
).be used with value literals, the breakage caused by this should be minimal.
Month
enum is used instead of numerical values where appropriate.Removed
PreciseTime
SteadyTime
precise_time_ns
precise_time_s
Instant::to
Duration::num_weeks
Duration::num_days
Duration::num_hours
Duration::num_minutes
Duration::num_seconds
Duration::num_milliseconds
Duration::num_microseconds
Duration::num_nanoseconds
Duration::span
Duration::from_std
Duration::to_std
Date::from_ymd
Date::from_yo
Date::from_iso_ywd
Date::with_hms
Date::with_hms_milli
Date::with_hms_micro
Date::with_hms_nano
Time::from_hms
Time::from_hms_milli
Time::from_hms_micro
Time::from_hms_nano
Date::today
Time::now
PrimitiveDateTime::now
PrimitiveDateTime::unix_epoch
PrimitiveDateTime::from_unix_timestamp
PrimitiveDateTime::timestamp
OffsetDateTime::now
impl Sub<SystemTime> for PrimitiveDateTime
impl Sub<PrimitiveDateTime> for SystemTime
impl PartialEq<SystemTime> for PrimitiveDateTime
impl PartialEq<PrimitiveDateTime> for SystemTime
impl PartialOrd<SystemTime> for PrimitiveDateTime
impl PartialOrd<PrimitiveDateTime> for SystemTime
impl From<SystemTime> for PrimitiveDateTime
impl From<PrimitiveDateTime> for SystemTime
UtcOffset::local_offset_at
— assumed UTC if unable to determine local offsetOffsetDateTime::now_local
— assumed UTC if unable to determine local offsetDuration::sign
PrimitiveDateTime::using_offset
Sign
days_in_year
is_leap_year
validate_format_string
weeks_in_year
ComponentRangeError
ConversionRangeError
IndeterminateOffsetError
ParseError
NumericalDuration
NumericalStdDuration
NumericalStdDurationShort
fmt::Error
, indicatingan error unrelated to the time crate.
Time::lazy_format
Date::lazy_format
UtcOffset::lazy_format
PrimitiveDateTime::lazy_format
OffsetDateTime::lazy_format
prelude
module has been removed in its entirety.Date::iso_year_week
in favor ofDate::to_iso_week_date
PrimitiveDateTime::iso_year_week
OffsetDateTime::iso_year_week
UtcOffset::east_hours
UtcOffset::west_hours
UtcOffset::hours
UtcOffset::east_minutes
UtcOffset::west_minutes
UtcOffset::minutes
UtcOffset::east_seconds
UtcOffset::west_seconds
UtcOffset::seconds
Date::month_day
PrimitiveDateTime::month_day
OffsetDateTime::month_day
Weekday::iso_weekday_number
(identical toWeekday::number_from_monday
)ext::NumericalStdDurationShort
v0.2.27
Compare Source
v0.2.26
Compare Source
Fixed
v0.2.25
Compare Source
Fixed
v0.2.24
Compare Source
Fixed
OffsetDateTime::timestamp
,OffsetDateTime::unix_timestamp
,PrimitiveDatetime::timestamp
, andOffsetDateTime::unix_timestamp
have been corrected. Thisaffects all negative timestamps with a nonzero subsecond value.
v0.2.23
Compare Source
Compatibility notes
Due to #293, any method that requires knowledge of the local offset will now
fail on Linux. For
try_
methods, this means returning an error. For others,it means assuming UTC.
Deprecated
UtcOffset::timestamp
(moved toUtcOffset::unix_timestamp
)UtcOffset::timestamp_nanos
(moved toUtcOffset::unix_timestamp_nanos
)date
(moved tomacros::date
)time
(moved tomacros::time
)offset
(moved tomacros::offset
)OffsetDateTime::now_local
(assumes UTC if unable to be determined)UtcOffset::local_offset_at
(assumes UTC if unable to be determined)UtcOffset::current_local_offset
(assumes UTC if unable to be determined)v0.2.22
Compare Source
Fixed
Duration::new
could previously result in an inconsistent internal state. This led to some oddsituations where a
Duration
could be both positive and negative. This has been fixed such thatthe internal state maintains its invariants.
v0.2.21
Compare Source
Changed
component being out of range can be directly obtained, while an invalid offset or conversion error
is guaranteed to be a zero-sized type.
const fn
on rustc ≥ 1.46:Date::try_from_iso_ywd
Date::iso_year_week
Date::week
Date::sunday_based_week
Date::monday_based_week
Date::try_with_hms
Date::try_with_hms_milli
Date::try_with_hms_micro
Date::try_with_hms_nano
PrimitiveDateTime::iso_year_week
PrimitiveDateTime::week
PrimitiveDateTime::sunday_based_week
PrimitiveDateTime::monday_based_week
util::weeks_in_year
v0.2.20
Compare Source
Added
OffsetDateTime::timestamp_nanos
OffsetDateTime::from_unix_timestamp_nanos
Fixed
A bug with far-reaching consequences has been fixed. See #276 for complete details, but the gist is
that the constructing a
Date
from a valid Julian day may result in an invalid value or even panic.As a consequence of implementation details, this affects nearly all arithmetic with
Date
s (and asa result also
PrimitiveDateTime
s andOffsetDateTime
s).Improvements
OffsetDateTime
from a timestamp-nanosecond pairv0.2.19
Compare Source
Fixed
COMPILING_UNDER_CARGO_WEB
environmentvariable.
%D
specifier no longer requires padding on the month. Previously,Err(InvalidMonth)
was incorrectly returned.std::time::Duration
that is larger thantime::Duration::max_value()
now correctly returnsOrdering::Greater
when compared.Sign::Zero
now sets the integer to be zero. Thispreviously left the integer unmodified.
v0.2.18
Compare Source
Changed
const fn
on rustc ≥ 1.46:Date::try_from_ymd
Date::try_from_yo
Time::try_from_hms
Time::try_from_hms_milli
Time::try_from_hms_micro
Time::try_from_hms_nano
error
module has been created where all existing error types are contained. TheError
suffix has been dropped from these types.
ext
module has been created where extension traits are contained.util
module has been created where utility functions are contained.error::ComponentRange
now implementsCopy
.For back-compatibility, all items that were moved to newly-contained modules have been re-exported
from their previous locations (and in the case of the
error
module, with their previous name).Fixes
Parsing
format::Rfc3339
now correctly handles the UTC offset (#274).v0.2.17
Compare Source
Changed
The following functions are
const fn
on rustc ≥ 1.46:Date::year
Date::month
Date::day
Date::month_day
Date::ordinal
Date::as_ymd
Date::as_yo
Date::julian_day
Duration::checked_div
PrimitiveDateTime::year
PrimitiveDateTime::month
PrimitiveDateTime::day
PrimitiveDateTime::month_day
PrimitiveDateTime::ordinal
Weekday::previous
Weekday::next
Improvements
size_of::<Date>()
has been reduced from 8 to 4. As a consequence,size_of::<PrimitiveDatetime>()
went from 16 to 12 andsize_of::<OffsetDateTime>()
from 20to 16. This change also results in a performance improvement of approximately 30% on the
Date::year
andDate::ordinal
methods.cfg-if
has been removed as a dependency.Fixed
cfg
flags passed to rustc will no longer collide with other crates (at least unless they'redoing something very stupid).
combinations would fail.
v0.2.16
Compare Source
Added
OffsetDateTime
s can now be represented as Unix timestamps with serde. To do this, you can use thetime::serde::timestamp
andtime::serde::timestamp::option
modules.v0.2.15
Compare Source
Fixed
cargo-web
support works, and is now explicitly checked in CI. A previous change was made that madea method call ambiguous.
v0.2.14
Compare Source
Fixed
Adding/subtracting a
core::time::Duration
now correctly takes subsecond values into account. Thisalso affects
PrimitiveDateTime
andOffsetDateTime
.v0.2.13
Compare Source
Fixed
Panicking APIs are re-exposed.
v0.2.12
Compare Source
Fixed
Subtracting
Instant
s can correctly result in a negative duration, rather than resulting in theabsolute value of it.
v0.2.11
Compare Source
Added
OffsetDateTime::now_utc
Deprecated
OffsetDateTime::now
due to the offset not being clear from the method name alone.Fixed
Date
s are now uniformly random when using therand
crate. Previously, both the year and daywithin the year were uniform, but this meant that any given day in a leap year was slightly less
likely to be chosen than a day in a non-leap year.
Changed
v0.2.10
Compare Source
Added
OffsetDateTime
s as RFC3339.impl Display
, rather than a concrete type.Fixed
v0.2.9
Compare Source
Fixed
cfg-if
now has a mandatory minimum of 0.1.10, rather than just 0.1. This is because compilationfails when using 0.1.9.
v0.2.8
Compare Source
Added
cargo_web
support has been added for getting a local offset. A general catch-all defaulting toUTC has also been added.
Error::source
has been implemented for the wrappertime::Error
.UtcOffset::try_local_offset
,UtcOffset::try_current_local_offset
,OffsetDateTime::try_now_local()
provide fallible alternatives when the default of UTC is notdesired. To facilitate this change,
IndeterminateOffsetError
has been added.Changed
#[non_exhaustive]
is simulated on compilers prior to 1.40.0.v0.2.7
Compare Source
Added
Display
has been implemented forDate
,OffsetDateTime
,PrimitiveDateTime
,Time
,UtcOffset
, andWeekday
.Hash
is now derived forDuration
.SystemTime
can be converted to and fromOffsetDateTime
. The following trait implementationshave been made for interoperability:
impl Sub<SystemTime> for OffsetDateTime
impl Sub<OffsetDateTime> for SystemTime
impl PartialEq<SystemTime> for OffsetDateTime
impl PartialEq<OffsetDateTime> for SystemTime
impl PartialOrd<SystemTime> for OffsetDateTime
impl PartialOrd<OffsetDateTime> for SystemTime
impl From<SystemTime> for OffsetDateTime
impl From<OffsetDateTime> for SystemTime
impl Duration<T> for Standard
, allowing usage with therand
crate. This isgated behind the
rand
feature flag.NumericalDuration
has been implemented forf32
andf64
.NumericalStdDuration
andNumericalStdDurationShort
have been implemented forf64
only.UtcOffset::local_offset_at(OffsetDateTime)
, which will obtain the system's local offset at theprovided moment in time.
OffsetDateTime::now_local()
is equivalent to callingOffsetDateTime::now().to_offset(UtcOffset::local_offset_at(OffsetDateTime::now()))
(but moreefficient).
UtcOffset::current_local_offset()
will return the equivalent ofOffsetDateTime::now_local().offset()
.Changed
impl AsRef<str>
as parameters, rather than just&str
.time::validate_format_string
does this as well.Date
being between the years -100,000 and +100,000 (inclusive) is nowstrictly enforced.
Duration
are now enabled by default. This behavior is the identical to whatthe standard library does.
time
,date
, andoffset
macros have been added to the prelude.Deprecated
Sign
has been deprecated in its entirety, along withDuration::sign
.To obtain the sign of a
Duration
, you can use theDuration::is_positive
,Duration::is_negative
, andDuration::is_zero
methods.A number of functions and trait implementations that implicitly assumed a timezone (generally UTC)
have been deprecated. These are:
Date::today
Time::now
PrimitiveDateTime::now
PrimitiveDateTime::unix_epoch
PrimitiveDateTime::from_unix_timestamp
PrimitiveDateTime::timestamp
impl Sub<SystemTime> for PrimitiveDateTime
impl Sub<PrimitiveDateTime> for SystemTime
impl PartialEq<SystemTime> for PrimitiveDateTime
impl PartialEq<PrimitiveDateTime> for SystemTime>
impl PartialOrd<SystemTime> for PrimitiveDateTime
impl PartialOrd<PrimitiveDateTime> for SystemTime>
impl From<SystemTime> for PrimitiveDateTime
impl From<PrimitiveDateTime> for SystemTime
Fixed
Duration
is now always in range. Previously, it was possible (viaaddition and/or subtraction) to obtain a value that was not internally consistent.
Time::parse
erroneously returned anInvalidMinute
error when it was actually the second thatwas invalid.
Date::parse("0000-01-01", "%Y-%m-%d")
incorrectly returned anErr
(#221).v0.2.6
Compare Source
Bug fixes
v0.2.5 introduces a major inconsistency, not just in its behavior for
PrimitiveDateTime::using_offset
, but also changes its signature, rendering it incapable of being used inconst
contexts.Both the behavior and the function signature have been fixed, while still fixing the underlying issue.
PrimitiveDateTime::using_offset
mentions in the docs that thePrimitiveDateTime
is assumed to be UTC, and is converted to the provided offset. This was the previous behavior.The following functionality had bugs that were fixed (from v0.2.4):
OffsetDateTime::timestamp
OffsetDateTime::parse
OffsetDateTime
— Subsecond values were not checked previously. They also relied on the faulty timestamp implementation.OffsetDateTime
— Same as equality and comparison. Additionally, hashes would collide withPrimitiveDateTime
if the underlying UTC was the same.OffsetDateTime
s previously disregarded the subsecond values.All of these changes are now checked in CI, so regressions will be caught.
v0.2.5
Compare Source
Bug fixes
PrimitiveDateTime::using_offset
was poorly defined, leading to an ambiguity that cause some methods to treat the existing datetime as UTC, while others treated it as the time in the provided offset. This release ensures that the behavior is what I intended — the datetime is assumed to be in the provided offset.NB: This release has been yanked from crates.io due to major back-compatibility issues. These have been fixed in 0.2.6.
v0.2.4
Compare Source
v0.2.4 is identical to v0.2.3 with the exception of the breaking change, which has been reverted. v0.2.4 is backwards-compatible with v0.2.2.
v0.2.3
Compare Source
v0.2.3 has been yanked from crates.io. The breaking change (with regard to feature flags) should not have been made. By yanking this version, any existing code will continue to work, while new code will not have potential backwards-incompatible behavior. The change was reverted in v0.2.4.
Additions
time!
,date!
,offset!
macrosparse
function, allowing for type inference.time::Result<T>
alias totime::Result<T, time::Error>
Deprecated
Panicking APIs have been deprecated in favor of the new macros.
Changes
Minimum supported Rust version is now 1.34, changed from 1.40. This permits a number of crates to upgrade without breaking MSRV.
Bug fixes
A number of parsing methods used unchecked constructors. This was because the values should have been checked prior. They are now.
Breaking changes
The "std" feature has been renamed to "alloc", which disables the standard library. This was necessary to bring MSRV down to 1.34.
v0.2.2
Compare Source
Fixed
v0.2.1
Compare Source
Fixed
COMPILING_UNDER_CARGO_WEB
environmentvariable.
%D
specifier no longer requires padding on the month. Previously,Err(InvalidMonth)
was incorrectly returned.std::time::Duration
that is larger thantime::Duration::max_value()
now correctly returnsOrdering::Greater
when compared.Sign::Zero
now sets the integer to be zero. Thispreviously left the integer unmodified.
tokio-rs/tokio
v1.21.2
: Tokio v1.21.2Compare Source
1.21.2 (September 27, 2022)
This release removes the dependency on the
once_cell
crate to restore the MSRV of 1.21.x, which is the latest minor version at the time of release. (#5048)v1.21.1
: Tokio v1.21.1Compare Source
1.21.1 (September 13, 2022)
Fixed
LocalSet
Drop (#4976)v1.21.0
: Tokio v1.21.0Compare Source
1.21.0 (September 2, 2022)
This release is the first release of Tokio to intentionally support WASM. The
sync,macros,io-util,rt,time
features are stabilized on WASM. Additionally the wasm32-wasi target is given unstable support for thenet
feature.Added
device
andbind_device
methods to TCP/UDP sockets (#4882)tos
andset_tos
methods to TCP and UDP sockets (#4877)ServerOptions
(#4845)mpsc::Sender::max_capacity
method (#4904)mpsc::Sender
(#4595)LocalSet::enter
(#4765)JoinSet
andAbortHandle
(#4920)track_caller
to public APIs (#4805, #4848, #4852)wasm32-wasi
target (#4716)Fixed
linked_list::Link
impls (#4841)#[must_use]
to lock guards (#4886)recv
on closed and reopened broadcast channel (#4867)Changed
File::start_seek
(#4897)poll_read
(#4840)SignalKind
methods const (#4956)Internal changes
basic_scheduler::Config
(#4935)runtime
module (#4942)Documented
AsyncSeekExt::rewind
docs (#4893)try_read()
for zero-length buffers (#4937)Builder::worker_threads
(#4849)watch::Sender::send
improved (#4959)JoinHandle
(#4901)spawn_blocking
(#4811)Interval::tick
happens immediately (#4951)Unstable
Builder::spawn_on
(#4953)task::Builder::spawn*
methods fallible (#4823)v1.20.2
: Tokio v1.20.2Compare Source
1.20.2 (September 27, 2022)
This release removes the dependency on the
once_cell
crate to restore the MSRV of the 1.20.x LTS release. (#5048)tokio-rs/tracing
v0.1.37
: tracing 0.1.37Compare Source
This release of
tracing
incorporates changes fromtracing-core
v0.1.30 and
tracing-attributes
v0.1.23,including the new
Subscriber::on_register_dispatch
method for performing lateinitialization after a
Subscriber
is registered as aDispatch
, and bugfixesfor the
#[instrument]
attribute. Additionally, it fixes instances of thebare_trait_objects
lint, which is now a warning ontracing
's MSRV and willbecome an error in the next edition.
Fixed
#[instrument]
edfunctions (#2307)
type errors in
#[instrument]
edasync fn
s (#2270)syn
dependency to fix compilation with-Z minimal-versions
(#2246)bare_trait_objects
warning invalueset!
macro expansion (#2308)Added
Subscriber::on_register_dispatch
method (#2269)WeakDispatch
type andDispatch::downgrade()
function (#2293)Changed
tracing-core
: updated to 0.1.30tracing-attributes
: updated to 0.1.23Documented
tracing-web
][tracing-web] and [reqwest-tracing
][reqwest-tracing] to related crates (#2283,#2331)
Thanks to new contributors @compiler-errors, @e-nomem, @WorldSEnder, @Xiami2012,
and @tl-rodrigo-gryzinski, as well as @jswrenn and @CAD97, for contributing to
this release!
uuid-rs/uuid
v1.2.2
Compare Source
What's Changed
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.2.1...1.2.2
v1.2.1
Compare Source
What's Changed
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.2.0...1.2.1
v1.2.0
Compare Source
What's Changed
New Contributors
Full Changelog: https://github.com/uuid-rs/uuid/compare/1.1.2...1.2.0
Keats/validator
v0.16.0
required
does_not_contain
validatorConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.
329c971295
toa2849908a1
a2849908a1
to29e8a96233
29e8a96233
to3e9e0469f9