let skip_end_slashes s ~from = match string_rexists s ~from ~f:(fun c -> c <> '/') with | Some v -> `Ends_at v | None -> `All_slashes