chiark / gitweb /
otter.git
3 years agoProvide FutureTimeInstant, for use by dice
Ian Jackson [Fri, 15 Apr 2022 09:56:27 +0000 (10:56 +0100)]
Provide FutureTimeInstant, for use by dice

This loads and saves as a Duration.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodice: cooldown_path etc.: rename remaining proportion to "remprop"
Ian Jackson [Mon, 11 Apr 2022 21:07:58 +0000 (22:07 +0100)]
dice: cooldown_path etc.: rename remaining proportion to "remprop"

This distinguishes "remaining" (a duration) from "remprop" (a proportion).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodice: Cooldown template: Use total_ms for duration variable
Ian Jackson [Fri, 15 Apr 2022 17:47:14 +0000 (18:47 +0100)]
dice: Cooldown template: Use total_ms for duration variable

Make the units clearer.  We will provide a value for this from a
Serialize context struct in the Rust code, which is still to come.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodice: Generate cooldown template using extractor
Ian Jackson [Mon, 11 Apr 2022 20:32:28 +0000 (21:32 +0100)]
dice: Generate cooldown template using extractor

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMove die helper materials to dice/ subdirectory
Ian Jackson [Mon, 11 Apr 2022 19:57:48 +0000 (20:57 +0100)]
Move die helper materials to dice/ subdirectory

This declutters the toplevel a bit.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSpecial client rendering: Do explain why not to provide xdata here
Ian Jackson [Fri, 15 Apr 2022 11:28:57 +0000 (12:28 +0100)]
Special client rendering: Do explain why not to provide xdata here

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSpecial client rendering: Fix quoting of JSON payload
Ian Jackson [Fri, 15 Apr 2022 17:54:07 +0000 (18:54 +0100)]
Special client rendering: Fix quoting of JSON payload

The needs to be in " " (and the JS will evaluate it).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide plumbing for special client rendering instructions
Ian Jackson [Mon, 11 Apr 2022 19:52:10 +0000 (20:52 +0100)]
Provide plumbing for special client rendering instructions

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMake PieceBaseTrait dyn_upcast-able
Ian Jackson [Thu, 14 Apr 2022 20:01:09 +0000 (21:01 +0100)]
Make PieceBaseTrait dyn_upcast-able

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agopcrender: prep for more attributes in pelem
Ian Jackson [Mon, 11 Apr 2022 19:38:37 +0000 (20:38 +0100)]
pcrender: prep for more attributes in pelem

We are going to add a .special.

NFC.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, add more tests
Ian Jackson [Mon, 11 Apr 2022 19:33:40 +0000 (20:33 +0100)]
die: wip svg, add more tests

Again, verified by hand-hacking and using Refresh in inkscape, that
they look right.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, cooldown timer better assert
Ian Jackson [Mon, 11 Apr 2022 19:31:29 +0000 (20:31 +0100)]
die: wip svg, cooldown timer better assert

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, fix cooldown timer path and add test cases
Ian Jackson [Mon, 11 Apr 2022 19:27:16 +0000 (20:27 +0100)]
die: wip svg, fix cooldown timer path and add test cases

I've verified that the 1. test case shows as expected.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, make example less than half
Ian Jackson [Mon, 11 Apr 2022 19:15:47 +0000 (20:15 +0100)]
die: wip svg, make example less than half

This let me c&p the string into the new test case.  Although, the test
will need to be different because of rounding errors.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodice: Provide die_cooldown_path
Ian Jackson [Mon, 11 Apr 2022 18:10:36 +0000 (19:10 +0100)]
dice: Provide die_cooldown_path

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, fix colour of white
Ian Jackson [Mon, 11 Apr 2022 17:50:49 +0000 (18:50 +0100)]
die: wip svg, fix colour of white

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg extractor
Ian Jackson [Mon, 11 Apr 2022 17:50:26 +0000 (18:50 +0100)]
die: wip svg extractor

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, change timewhite path (back) to a circle
Ian Jackson [Mon, 11 Apr 2022 17:10:45 +0000 (18:10 +0100)]
die: wip svg, change timewhite path (back) to a circle

We want to be able to auto-adjust it by fiddling with r=.  That's
going to be awkward with the path element but easy with circle.

I have checked that one can (eg) change the width of the line in
inkscaqpe, and it remains a circle.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, remove unneeded parts
Ian Jackson [Thu, 7 Apr 2022 16:44:59 +0000 (17:44 +0100)]
die: wip svg, remove unneeded parts

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg, remove zigzag
Ian Jackson [Thu, 7 Apr 2022 16:28:46 +0000 (17:28 +0100)]
die: wip svg, remove zigzag

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg
Ian Jackson [Thu, 7 Apr 2022 16:22:17 +0000 (17:22 +0100)]
die: wip svg

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg
Ian Jackson [Thu, 7 Apr 2022 16:17:15 +0000 (17:17 +0100)]
die: wip svg

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodie: wip svg
Ian Jackson [Thu, 7 Apr 2022 16:02:24 +0000 (17:02 +0100)]
die: wip svg

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoInertPieceTrait: Add comment clarifying FaceId etc.
Ian Jackson [Fri, 15 Apr 2022 10:50:07 +0000 (11:50 +0100)]
InertPieceTrait: Add comment clarifying FaceId etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoGamestate: Fix a more style nit
Ian Jackson [Fri, 15 Apr 2022 09:58:24 +0000 (10:58 +0100)]
Gamestate: Fix a more style nit

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoSpecError: Add a comma (for consistent coding style)
Ian Jackson [Thu, 14 Apr 2022 00:20:10 +0000 (01:20 +0100)]
SpecError: Add a comma (for consistent coding style)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoProvide load_inert for SimplePieceSpec
Ian Jackson [Fri, 15 Apr 2022 17:38:00 +0000 (18:38 +0100)]
Provide load_inert for SimplePieceSpec

This will let us use these as backgrounds for dice.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMove fn load out of SimplePieceSpec into macro
Ian Jackson [Fri, 15 Apr 2022 17:23:27 +0000 (18:23 +0100)]
Move fn load out of SimplePieceSpec into macro

The only call site was in impl_PieceSpec_for_SimplePieceSpec.
Hoisting it there makes little codegen difference but seems more
natural.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCombine impls into impl_PieceSpec_for_SimplePieceSpec
Ian Jackson [Fri, 15 Apr 2022 17:18:34 +0000 (18:18 +0100)]
Combine impls into impl_PieceSpec_for_SimplePieceSpec

We want to add load_inert to this.  It's getting too repetitive.

We can't use generic impl on <P: SimplePieceSpec> because we need to
specxify the serde typetag.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoPass face to InertPieceTrait::describe_html
Ian Jackson [Fri, 15 Apr 2022 10:40:56 +0000 (11:40 +0100)]
Pass face to InertPieceTrait::describe_html

This ought to have been part of
  Extend InertPieceTrait to support multiple faces

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMake OccultIlkName a type alias, not a newtype
Ian Jackson [Fri, 15 Apr 2022 10:26:00 +0000 (11:26 +0100)]
Make OccultIlkName a type alias, not a newtype

There's not really an abstraction here defending anything, and it
lacks constructors etc.  Just abolish it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoPlumb xdata through to InertPieceTrait svg
Ian Jackson [Thu, 14 Apr 2022 19:55:17 +0000 (20:55 +0100)]
Plumb xdata through to InertPieceTrait svg

Occulted dice will need this to display the cooldown timer.

This makes dice's InertPieceTrait impl not very inert, but it is OK
because nothing can set off an inert die's cooldown timer.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMove itemname into PieceBaseTrait
Ian Jackson [Thu, 14 Apr 2022 19:45:42 +0000 (20:45 +0100)]
Move itemname into PieceBaseTrait

We want this becasue dice want to use inert pieces as images, and use
their images' item names in their own item names.

This involves providing an itemname for ItemInertForOcculted.
Happily the SvgBaseName will do nicely.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce PieceBaseTrait and put nfaces() in it
Ian Jackson [Thu, 14 Apr 2022 19:03:34 +0000 (20:03 +0100)]
Introduce PieceBaseTrait and put nfaces() in it

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agohumantime: Switch to humantime_serde
Ian Jackson [Wed, 13 Apr 2022 21:32:56 +0000 (22:32 +0100)]
humantime: Switch to humantime_serde

We are going to want this for dice cooldown spec.
Using the humantime re-export avoids version problems.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agohumantime: Promote dependency to otter main crate
Ian Jackson [Wed, 13 Apr 2022 21:28:31 +0000 (22:28 +0100)]
humantime: Promote dependency to otter main crate

We are going to want this for dice cooldown spec.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agospec errors: Expand WrongNumberOfFaces error
Ian Jackson [Tue, 12 Apr 2022 20:33:51 +0000 (21:33 +0100)]
spec errors: Expand WrongNumberOfFaces error

We're going to want to reuse this in a new context.  And, this already
produces better error messages for the case where it's used now.

It seems better to provide this rather generic error rather than
expect each funky piece kind to invent its own kind in SpecError.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodocs: Document scope of semver guarantees
Ian Jackson [Tue, 12 Apr 2022 20:33:28 +0000 (21:33 +0100)]
docs: Document scope of semver guarantees

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMake GenericSimpleShape::count_faces return RawFaceId
Ian Jackson [Tue, 12 Apr 2022 20:12:49 +0000 (21:12 +0100)]
Make GenericSimpleShape::count_faces return RawFaceId

RawFaceId is smaller than usize.  It is better not to ask callers to
do the unwrap.  Motivated by wanting add a new call site which wants a
RawFaceId.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoExtend load_inert to offer an occultable piece
Ian Jackson [Tue, 12 Apr 2022 00:18:22 +0000 (01:18 +0100)]
Extend load_inert to offer an occultable piece

Now inert pieces can be occultable too.  Currently this is meaningless
since we only call load_inert when resolving the occultation
for *another* piece, where we discard the occultation information.

But that is going to change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoGenericise SpecLoaded
Ian Jackson [Tue, 12 Apr 2022 00:12:48 +0000 (01:12 +0100)]
Genericise SpecLoaded

We are going to want to make inert pieces occultable too.  Currently
this is meaningless since we only call load_inert when resolving the
occultation for *another* piece.  But that is going to change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoFix message for IE::JSONEncode
Ian Jackson [Mon, 11 Apr 2022 19:51:12 +0000 (20:51 +0100)]
Fix message for IE::JSONEncode

The name is JSONEncode, so this must be serialisation, and indeed that
is true of both the construction sites.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoImplement InertPieceTrait for SimpleShape
Ian Jackson [Mon, 11 Apr 2022 09:50:03 +0000 (10:50 +0100)]
Implement InertPieceTrait for SimpleShape

Right now, this allows simple circles and rectangles to be used as
backs (for occultation).  It will also allow them to be used for dice,
when we have those.

It is not convenient to provide a test for this because occultation
methods must be provided in libraries, and we don't have a test
library.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoStyle: tidy up and use fehler
Ian Jackson [Mon, 11 Apr 2022 09:45:39 +0000 (10:45 +0100)]
Style: tidy up and use fehler

Empirically, without the let r = ...; r, fehler and if_chain! produce
a type error.  That must be why we had the fehler use commented out.
But this way it works.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoExtend InertPieceTrait to support multiple faces
Ian Jackson [Mon, 11 Apr 2022 09:18:12 +0000 (10:18 +0100)]
Extend InertPieceTrait to support multiple faces

We want this because we want to use InertPiece for dice and a die can
have multiple faces, which we want to specify as a single piece.  Ie,
the die face images will be an inert version of the die.

No functional change right now - we just move the default() call out
from the trait impls to each of the call sites.  In the shapelib
impl (which is the only impl right now) we pass through the face to
the rendering code (which lives in the main PieceTrait impl).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce "inert" terminology for images for occultation
Ian Jackson [Mon, 11 Apr 2022 09:03:27 +0000 (10:03 +0100)]
Introduce "inert" terminology for images for occultation

This is much less confusing.  In particular, I'm trying to distinguish
the occulted piece from the piece (or trait object) which the occulted
piece provides (to the caller of `load`) for its occulted image.

No functional change other than wording in an error message.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoReplace a Mutex which was being an open-coded Lazy
Ian Jackson [Mon, 11 Apr 2022 08:50:47 +0000 (09:50 +0100)]
Replace a Mutex which was being an open-coded Lazy

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRename make_svg_defs
Ian Jackson [Sun, 10 Apr 2022 21:40:27 +0000 (22:40 +0100)]
Rename make_svg_defs

This is the thing that generates SVG.  That's worth mentioning.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRemove loaded_via_alias
Ian Jackson [Sat, 9 Apr 2022 16:05:35 +0000 (17:05 +0100)]
Remove loaded_via_alias

This effectively reverts 707b43736d838436777f53b230e64054ecb244c5.

I have checked that this field is not used anywhere, including in any
relevant serialised output eg via the command listener.  As for game
save compatibility, we can simply ignore it on read (and, even go
backwards since it's Option).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCargo.toml: Update all versions to 1.0.0 otter-1.0.0
Ian Jackson [Sat, 2 Apr 2022 14:15:25 +0000 (15:15 +0100)]
Cargo.toml: Update all versions to 1.0.0

Commit made automatically by update-versions.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agochangelog: Document that this is version 1.0.0
Ian Jackson [Sat, 2 Apr 2022 13:01:12 +0000 (14:01 +0100)]
changelog: Document that this is version 1.0.0

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agochangelog: Document changes since 0.7.3
Ian Jackson [Sat, 2 Apr 2022 12:23:35 +0000 (13:23 +0100)]
changelog: Document changes since 0.7.3

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodaemon: Move src_service into services! call
Ian Jackson [Sat, 2 Apr 2022 14:11:04 +0000 (15:11 +0100)]
daemon: Move src_service into services! call

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoinventory: Postpone this TODO
Ian Jackson [Sat, 2 Apr 2022 14:12:51 +0000 (15:12 +0100)]
inventory: Postpone this TODO

So far things still seem to be working, despite upstream rust problems
with #[used].

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDocument new build disk space requirement - reduced !
Ian Jackson [Sat, 2 Apr 2022 13:11:39 +0000 (14:11 +0100)]
Document new build disk space requirement - reduced !

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodaemon: Reorder routes in order of likely frequency
Ian Jackson [Sat, 2 Apr 2022 14:09:01 +0000 (15:09 +0100)]
daemon: Reorder routes in order of likely frequency

I'm not sure if this is at all relevant but it seems sensible
and is at worst harmless.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Revamp /_/{resource} handling
Ian Jackson [Sat, 2 Apr 2022 12:56:25 +0000 (13:56 +0100)]
actix: Revamp /_/{resource} handling

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agorelease checklist: Drop entry about nightly
Ian Jackson [Sat, 2 Apr 2022 12:22:14 +0000 (13:22 +0100)]
release checklist: Drop entry about nightly

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoFormulaic doc comments for other crates
Ian Jackson [Sat, 2 Apr 2022 11:55:11 +0000 (12:55 +0100)]
Formulaic doc comments for other crates

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoBespoke doc comments for otter, otter-cli and otter-daemon
Ian Jackson [Sat, 2 Apr 2022 11:54:37 +0000 (12:54 +0100)]
Bespoke doc comments for otter, otter-cli and otter-daemon

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDrop unused dependency: failure
Ian Jackson [Sat, 2 Apr 2022 10:38:56 +0000 (11:38 +0100)]
Drop unused dependency: failure

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: Update zip (zipfile) dependency
Ian Jackson [Fri, 1 Apr 2022 22:44:12 +0000 (23:44 +0100)]
cargo: Update zip (zipfile) dependency

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCargo update
Ian Jackson [Fri, 1 Apr 2022 22:41:41 +0000 (23:41 +0100)]
Cargo update

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: Build wasm-bindgen with selected rust version too
Ian Jackson [Fri, 1 Apr 2022 22:33:19 +0000 (23:33 +0100)]
Makefile: Build wasm-bindgen with selected rust version too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDeploy release build
Ian Jackson [Fri, 1 Apr 2022 22:08:43 +0000 (23:08 +0100)]
Deploy release build

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTurn on integer overflow checks for release builds
Ian Jackson [Fri, 1 Apr 2022 22:08:17 +0000 (23:08 +0100)]
Turn on integer overflow checks for release builds

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Fix CORS
Ian Jackson [Fri, 1 Apr 2022 21:57:21 +0000 (22:57 +0100)]
actix: Fix CORS

The docs aren't entirely clear but suggest that the default allowed
origins is All.  But dbg! output seems to contradict this.  And we
should support more headers, and say that we don't vary our CORS at
all.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDocs update: Not beta, works on stable
Ian Jackson [Fri, 1 Apr 2022 21:33:03 +0000 (22:33 +0100)]
Docs update: Not beta, works on stable

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: Arrangements for honouring RUST_VERSION
Ian Jackson [Fri, 1 Apr 2022 21:32:34 +0000 (22:32 +0100)]
Makefile: Arrangements for honouring RUST_VERSION

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoUpdate TODOs
Ian Jackson [Thu, 31 Mar 2022 20:05:37 +0000 (21:05 +0100)]
Update TODOs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 20:05:08 +0000 (21:05 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 20:00:21 +0000 (21:00 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 19:58:16 +0000 (20:58 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 19:56:12 +0000 (20:56 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 19:44:50 +0000 (20:44 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapitest: Fix a write() call that should be write_all()
Ian Jackson [Thu, 31 Mar 2022 19:39:56 +0000 (20:39 +0100)]
apitest: Fix a write() call that should be write_all()

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 19:39:47 +0000 (20:39 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoUpdate TODOs
Ian Jackson [Thu, 31 Mar 2022 19:39:07 +0000 (20:39 +0100)]
Update TODOs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoUse Educe to impl Default on a couple of types in clisupport
Ian Jackson [Thu, 31 Mar 2022 19:31:27 +0000 (20:31 +0100)]
Use Educe to impl Default on a couple of types in clisupport

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 19:25:30 +0000 (20:25 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 19:17:01 +0000 (20:17 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 19:12:40 +0000 (20:12 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoparse_slice_hex: Fix to properly handle odd-length slices
Ian Jackson [Thu, 31 Mar 2022 19:09:35 +0000 (20:09 +0100)]
parse_slice_hex: Fix to properly handle odd-length slices

Previously it would accept some of them, and parse them in a weird
way.  I don't think this is actually important.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 19:09:22 +0000 (20:09 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 02:14:19 +0000 (03:14 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoPlayerUpdates: Rename update log starting functions and types
Ian Jackson [Thu, 31 Mar 2022 02:11:09 +0000 (03:11 +0100)]
PlayerUpdates: Rename update log starting functions and types

Prompted by clippy complaining about the old weird new() function.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 02:00:56 +0000 (03:00 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agotermprogress: Rename reporter() functions returning Box<dyn>
Ian Jackson [Thu, 31 Mar 2022 01:56:46 +0000 (02:56 +0100)]
termprogress: Rename reporter() functions returning Box<dyn>

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 01:52:58 +0000 (02:52 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 01:50:40 +0000 (02:50 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes, and allow lints
Ian Jackson [Thu, 31 Mar 2022 01:46:07 +0000 (02:46 +0100)]
clippy: Miscellaneous minor changes, and allow lints

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agopacketframe: Fix a write() call that should be write_all()
Ian Jackson [Thu, 31 Mar 2022 01:44:19 +0000 (02:44 +0100)]
packetframe: Fix a write() call that should be write_all()

I think this was probably a bug.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 01:43:49 +0000 (02:43 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 01:31:04 +0000 (02:31 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Suppress a buggy lint
Ian Jackson [Thu, 31 Mar 2022 01:25:56 +0000 (02:25 +0100)]
clippy: Suppress a buggy lint

This fires on process_all_players_for_account, but the collect
*is* needed and the suggestion doesn't compile.

I wasn't able to make a minimal repro, but there is what looks like a
report of the same thing (and many other issues with this lint).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 01:17:03 +0000 (02:17 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRawToken: Replace constructor with a From impl
Ian Jackson [Thu, 31 Mar 2022 00:34:37 +0000 (01:34 +0100)]
RawToken: Replace constructor with a From impl

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 00:34:27 +0000 (01:34 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Miscellaneous minor changes
Ian Jackson [Thu, 31 Mar 2022 00:27:10 +0000 (01:27 +0100)]
clippy: Miscellaneous minor changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoclippy: Prefer .len() > 0 to ! .is_empty()
Ian Jackson [Thu, 31 Mar 2022 00:21:33 +0000 (01:21 +0100)]
clippy: Prefer .len() > 0 to ! .is_empty()

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>