Skip to content

Commit 874e930

Browse files
authored
Include .h from .inc/.inl files (NFC) (#3017)
This helps both IDEs and linting tools. Also add some missing braces.
1 parent be0af2b commit 874e930

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

include/frc2/command/SwerveControllerCommand.inc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#pragma once
66

77
#include <memory>
8+
#include <utility>
9+
10+
#include "frc2/command/SwerveControllerCommand.h"
811

912
namespace frc2 {
1013

@@ -17,11 +20,11 @@ SwerveControllerCommand<NumModules>::SwerveControllerCommand(
1720
std::function<frc::Rotation2d()> desiredRotation,
1821
std::function<void(std::array<frc::SwerveModuleState, NumModules>)> output,
1922
std::initializer_list<Subsystem*> requirements)
20-
: m_trajectory(trajectory),
21-
m_pose(pose),
23+
: m_trajectory(std::move(trajectory)),
24+
m_pose(std::move(pose)),
2225
m_kinematics(kinematics),
2326
m_controller(xController, yController, thetaController),
24-
m_desiredRotation(desiredRotation),
27+
m_desiredRotation(std::move(desiredRotation)),
2528
m_outputStates(output) {
2629
this->AddRequirements(requirements);
2730
}
@@ -34,8 +37,8 @@ SwerveControllerCommand<NumModules>::SwerveControllerCommand(
3437
frc::ProfiledPIDController<units::radians> thetaController,
3538
std::function<void(std::array<frc::SwerveModuleState, NumModules>)> output,
3639
std::initializer_list<Subsystem*> requirements)
37-
: m_trajectory(trajectory),
38-
m_pose(pose),
40+
: m_trajectory(std::move(trajectory)),
41+
m_pose(std::move(pose)),
3942
m_kinematics(kinematics),
4043
m_controller(xController, yController, thetaController),
4144
m_outputStates(output) {
@@ -54,11 +57,11 @@ SwerveControllerCommand<NumModules>::SwerveControllerCommand(
5457
std::function<frc::Rotation2d()> desiredRotation,
5558
std::function<void(std::array<frc::SwerveModuleState, NumModules>)> output,
5659
wpi::ArrayRef<Subsystem*> requirements)
57-
: m_trajectory(trajectory),
58-
m_pose(pose),
60+
: m_trajectory(std::move(trajectory)),
61+
m_pose(std::move(pose)),
5962
m_kinematics(kinematics),
6063
m_controller(xController, yController, thetaController),
61-
m_desiredRotation(desiredRotation),
64+
m_desiredRotation(std::move(desiredRotation)),
6265
m_outputStates(output) {
6366
this->AddRequirements(requirements);
6467
}
@@ -71,8 +74,8 @@ SwerveControllerCommand<NumModules>::SwerveControllerCommand(
7174
frc::ProfiledPIDController<units::radians> thetaController,
7275
std::function<void(std::array<frc::SwerveModuleState, NumModules>)> output,
7376
wpi::ArrayRef<Subsystem*> requirements)
74-
: m_trajectory(trajectory),
75-
m_pose(pose),
77+
: m_trajectory(std::move(trajectory)),
78+
m_pose(std::move(pose)),
7679
m_kinematics(kinematics),
7780
m_controller(xController, yController, thetaController),
7881
m_outputStates(output) {

0 commit comments

Comments
 (0)