File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ resolver = "3"
55[workspace .package ]
66version = " 0.4.8"
77edition = " 2024"
8- rust-version = " 1.94 "
8+ rust-version = " 1.95 "
99repository = " https://github.com/j178/prek"
1010homepage = " https://prek.j178.dev/"
1111license = " MIT"
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ cargo binstall prek
151151
152152<!-- --8<-- [start: cargo-install] -->
153153
154- Build from source using Cargo (Rust 1.89 + is required):
154+ Build from source using Cargo (Rust 1.95 + is required):
155155
156156``` bash
157157cargo install --locked prek
Original file line number Diff line number Diff line change @@ -722,11 +722,7 @@ fn detail_lines_for_entry(
722722
723723 match kind {
724724 RemovalKind :: Repos => vec ! [ ] ,
725- RemovalKind :: HookEnvs => {
726- let Some ( info) = hook_marker else {
727- return Vec :: new ( ) ;
728- } ;
729-
725+ RemovalKind :: HookEnvs if let Some ( info) = hook_marker => {
730726 let mut lines = Vec :: new ( ) ;
731727 lines. push ( format ! (
732728 "{}: {} ({})" ,
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ impl DirectHookEntry {
143143 pub ( crate ) fn split ( & self ) -> Result < Vec < String > , Error > {
144144 let splits = shlex:: split ( & self . entry ) . ok_or_else ( || Error :: Hook {
145145 hook : self . hook . clone ( ) ,
146- error : anyhow:: anyhow!( "Failed to parse entry `{}` as commands" , & self . entry) ,
146+ error : anyhow:: anyhow!( "Failed to parse entry `{}` as commands" , self . entry) ,
147147 } ) ?;
148148 if splits. is_empty ( ) {
149149 return Err ( Error :: Hook {
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ fn validate_uv_binary(uv_path: &Path) -> Result<Version> {
111111 if !UV_VERSION_RANGE . matches ( & version) {
112112 bail ! (
113113 "uv version `{version}` does not satisfy required range `{}`" ,
114- & * UV_VERSION_RANGE
114+ * UV_VERSION_RANGE
115115 ) ;
116116 }
117117 Ok ( version)
@@ -600,7 +600,7 @@ mod tests {
600600 assert ! (
601601 UV_VERSION_RANGE . matches( & version) ,
602602 "CUR_UV_VERSION {CUR_UV_VERSION} does not satisfy the version requirement {}" ,
603- & * UV_VERSION_RANGE
603+ * UV_VERSION_RANGE
604604 ) ;
605605 }
606606
Original file line number Diff line number Diff line change @@ -123,23 +123,18 @@ static PAGE_SIZE: LazyLock<usize> = LazyLock::new(|| {
123123// https://github.com/uutils/findutils/blob/af48c151fe9b29cb7d25471b5388013ca15748ba/src/xargs/mod.rs#L177
124124// https://github.com/sharkdp/argmax
125125fn platform_max_cli_length ( ) -> usize {
126- #[ cfg( unix) ]
127- {
128- let mut arg_max = * ARG_MAX ;
129- // Assume arguments are counted with the granularity of a single page,
130- // so allow a one page cushion to account for rounding up
131- arg_max -= * PAGE_SIZE ;
132- // POSIX recommends an additional 2048 bytes of headroom
133- arg_max -= ARG_HEADROOM ;
134- arg_max. clamp ( 1 << 12 , 1 << 20 )
135- }
136- #[ cfg( windows) ]
137- {
138- ( 1 << 15 ) - ARG_HEADROOM // UNICODE_STRING max - headroom
139- }
140- #[ cfg( not( any( unix, windows) ) ) ]
141- {
142- 1 << 12
126+ cfg_select ! {
127+ unix => {
128+ let mut arg_max = * ARG_MAX ;
129+ // Assume arguments are counted with the granularity of a single page,
130+ // so allow a one page cushion to account for rounding up
131+ arg_max -= * PAGE_SIZE ;
132+ // POSIX recommends an additional 2048 bytes of headroom
133+ arg_max -= ARG_HEADROOM ;
134+ arg_max. clamp( 1 << 12 , 1 << 20 )
135+ } ,
136+ windows => ( 1 << 15 ) - ARG_HEADROOM , // UNICODE_STRING max - headroom
137+ _ => 1 << 12 ,
143138 }
144139}
145140
Original file line number Diff line number Diff line change 11[toolchain ]
2- channel = " 1.96 "
2+ channel = " 1.97 "
You can’t perform that action at this time.
0 commit comments