Commit Graph

14 Commits

Author SHA1 Message Date
Fabian Boehm
57317fdaf2 Remove now unused assert helpers 2024-02-22 20:10:16 +01:00
Johannes Altmanninger
a1ed63fd83 Make wcwidth an isize
Seems more consistent with the rest of our code.
2024-02-15 01:27:23 +01:00
Johannes Altmanninger
8545b5debe Remove obsolete no_mangle directives 2024-02-15 01:22:37 +01:00
David Adam
7dfe6f2c07 common.rs: drop unused PACKAGE_BUGREPORT constant 2024-02-11 21:06:37 +08:00
Fabian Boehm
8d71eef1da
Add feature flag to turn off %self (#10262)
This is the last remnant of the old percent expansion.

It has the downsides of it, in that it is annoying to combine with
anything:

```fish
echo %self/foo
```

prints "%self/foo", not fish's pid.

We have introduced $fish_pid in 3.0, which is much easier to use -
just like a variable, because it is one.

If you need backwards-compatibility for < 3.0, you can use the
following shim:

```fish
set -q fish_pid
or set -g fish_pid %self
```

So we introduce a feature-flag called "remove-percent-self" to turn it
off.

"%self" will simply not be special, e.g. `echo %self` will print
"%self".
2024-02-06 22:13:16 +01:00
ridiculousfish
9a0728eed6 Stop using num_traits in common.rs
This was a rather silly usage only for estimating string capacity in a rarely
used function. We can do without it.
2024-01-21 18:19:40 -08:00
ridiculousfish
3ecd835f58 Clean up some stale comments and restore libc usage in flog_safe
flog_safe should be explicitly async-signal-safe functions; let's avoid
nix in that module for this reason.
2024-01-21 12:03:56 -08:00
PolyMeilex
f3e8272c5d Move from libc read/write to nix read/write
Replace std from_raw_fd/into_raw_fd dance with nix write

Fixup notifyd build
2024-01-21 11:49:40 -08:00
Johannes Altmanninger
2059e5a171 Allow finding for empty strings with wstr::find
I hit this temporarily in a test; it seems reasonable to allow this.
std::str does too.
2024-01-20 11:30:13 +01:00
Mahmoud Al-Qudsi
a138d74688 Fix unused code warning on cannot-be-WSL platforms
No need to use cfg_attr and have to worry about syncing the preconditions for
the cfg_attr with the preconditions for where `slice_contains_slice()` is used
in the codebase, just mark it as `allow(unused)` with a comment.
2024-01-13 13:15:31 -06:00
Fabian Boehm
0a92d03498 Remove L! from sprintf calls
Remove unnecessary L!
2024-01-13 08:52:54 +01:00
Fabian Boehm
fae780d666 clippy
There are a bunch more now that widestrs is gone
2024-01-13 08:52:54 +01:00
Fabian Boehm
09cd7c7ad9 Remove widestring-suffix uses
This removes both the `#[widestrs]` annotation as well as all `"foo"L`
suffixes, and does a `cargo fmt` run on the result
2024-01-13 08:52:54 +01:00
Johannes Altmanninger
3ae20bdba0 Move fish-rust to project root 2024-01-13 03:58:33 +01:00