Commit 0fbc3a64 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'minor-nit'

fb1a5de3 rust: remove unnecessary clone calls
b6690705 api/doc: add note about label promotion endpoint
bcf5f3c5 clippy: silence non_exhaustive warning we can't handle right now
fe9987b1 api/common: sort imports
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !259
parents 30c35b5d fb1a5de3
......@@ -47,6 +47,8 @@ These API endpoints have been implemented.
* `GET /projects/:project/labels/:label` `projects/labels/labels.rs`
* `DELETE /projects/:project/labels/:label` `projects/labels/delete.rs`
* `PUT /projects/:project/labels/:label/promote` `projects/labels/promote.rs`
Arguably, this should be `POST /projects/:project/labels/:label/promote`.
https://gitlab.com/gitlab-org/gitlab/-/issues/219324#note_382305638
* `GET /projects/:project/members` `projects/members/members.rs`
* `GET /projects/:project/members/all` `projects/members/members.rs`
* `GET /projects/:project/members/all/:id` `projects/members/member.rs`
......
......@@ -289,10 +289,11 @@ impl ParamValue<'static> for ProtectedAccessLevel {
#[cfg(test)]
mod tests {
use std::cmp;
use crate::api::common::{
AccessLevel, EnableState, NameOrId, ProtectedAccessLevel, SortOrder, VisibilityLevel, YesNo,
};
use std::cmp;
#[test]
fn access_level_as_str() {
......
......@@ -6,6 +6,9 @@
// TODO: Document API entities.
// #![warn(missing_docs)]
// XXX(rust-1.45): #[non_exhaustive] is allowed now.
#![allow(clippy::unknown_clippy_lints)]
#![allow(clippy::manual_non_exhaustive)]
//! A library for communicating with Gitlab instances.
......
......@@ -360,8 +360,7 @@ impl<'de> Deserialize<'de> for SystemHook {
let val = <Value as Deserialize>::deserialize(deserializer)?;
let event_name = match val.pointer("/event_name") {
// XXX(1.36.0): NLL makes this clone unnecessary.
Some(&Value::String(ref name)) => name.clone(),
Some(&Value::String(ref name)) => name,
Some(_) => {
return Err(D::Error::invalid_type(
Unexpected::Other("JSON value"),
......
......@@ -734,8 +734,7 @@ impl<'de> Deserialize<'de> for WebHook {
let val = <Value as Deserialize>::deserialize(deserializer)?;
let object_kind = match val.pointer("/object_kind") {
// XXX(1.36.0): NLL makes this clone unnecessary.
Some(&Value::String(ref kind)) => kind.clone(),
Some(&Value::String(ref kind)) => kind,
Some(_) => {
return Err(D::Error::invalid_type(
Unexpected::Other("JSON value"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment